Packages

Erlang code generator for Idris 2

Current section

Files

Jump to
idris2 src Idris.Idris2.Utils.Escript.erl
Raw

src/Idris.Idris2.Utils.Escript.erl

-module('Idris.Idris2.Utils.Escript').
-compile('no_auto_import').
-compile('inline').
-compile({'inline_size',24}).
-export([
'case--readFile-1853'/4,
'case--listFiles-1770'/3,
'case--listFiles,zipFile-1690'/2,
'case--case block in case block in openArchive-1541'/8,
'case--case block in openArchive-1457'/5,
'case--openArchive-1396'/3,
'case--case block in getEscriptPath-1330'/3,
'case--getEscriptPath-1312'/1,
'nested--3391-1660--in--un--zipFile'/2,
'nested--3391-1661--in--un--row'/2,
'un--readFile'/3,
'un--openArchive'/2,
'un--listFiles'/2,
'un--getEscriptPath'/1,
'un--closeArchive'/2
]).
'case--readFile-1853'(V0, V1, V2, V3) -> case V3 of {'Idris.Prelude.Types.Right', E0} -> (fun (V4) -> case V4 of {E1, E2} -> (fun (V5, V6) -> fun (V7) -> {'Idris.Prelude.Types.Just', V6} end end(E1, E2)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end(E0)); {'Idris.Prelude.Types.Left', E3} -> (fun (V8) -> fun (V9) -> {'Idris.Prelude.Types.Nothing'} end end(E3)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--listFiles-1770'(V0, V1, V2) -> case V2 of {'Idris.Prelude.Types.Right', E0} -> (fun (V3) -> fun (V4) -> {'Idris.Prelude.Types.Just', ('Idris.Idris2.Data.List':'un--mapMaybe'('erased', 'erased', fun (V5) -> V5 end, V3))} end end(E0)); {'Idris.Prelude.Types.Left', E1} -> (fun (V6) -> fun (V7) -> {'Idris.Prelude.Types.Nothing'} end end(E1)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--listFiles,zipFile-1690'(V0, V1) -> case V1 of {E0, E1, E2, E3, E4, E5} -> (fun (V2, V3, V4, V5, V6, V7) -> case V3 of E6 -> (fun (V8) -> V8 end((fun (V9) -> ('unicode':'characters_to_binary'(V9)) end(E6)))); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end(E0, E1, E2, E3, E4, E5)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--case block in case block in openArchive-1541'(V0, V1, V2, V3, V4, V5, V6, V7) -> case V7 of {'Idris.Prelude.Types.Right', E0} -> (fun (V8) -> fun (V9) -> {'Idris.Prelude.Types.Just', V8} end end(E0)); {'Idris.Prelude.Types.Left', E1} -> (fun (V10) -> fun (V11) -> {'Idris.Prelude.Types.Nothing'} end end(E1)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--case block in openArchive-1457'(V0, V1, V2, V3, V4) -> case V4 of {'Idris.Prelude.Types.Right', E0} -> (fun (V5) -> case V5 of {E1, E2} -> (fun (V6, V7) -> fun (V8) -> begin (V9 = ('erlang':'apply'('zip', 'zip_open', [V7 | [['memory' | []] | []]]))), (('case--case block in case block in openArchive-1541'(V0, V1, V2, V3, V6, V7, V9, ('Idris.Idris2.Erlang.Decode':'un--erlDecode'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V10) -> ('Idris.Idris2.Erlang.Decode':'un--okTuple'('erased', fun (V11) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V11)) end, V10)) end, V9))))(V8)) end end end(E1, E2)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end(E0)); {'Idris.Prelude.Types.Left', E3} -> (fun (V12) -> fun (V13) -> {'Idris.Prelude.Types.Nothing'} end end(E3)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--openArchive-1396'(V0, V1, V2) -> case V2 of {'Idris.Prelude.Types.Right', E0} -> (fun (V3) -> fun (V4) -> begin (V5 = ('erlang':'apply'('proplists', 'lookup', ['archive' | [V3 | []]]))), (('case--case block in openArchive-1457'(V0, V1, V3, V5, ('Idris.Idris2.Erlang.Decode':'un--erlDecode'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V6) -> ('Idris.Idris2.Erlang.Decode':'un--tuple2'('erased', 'erased', fun (V7) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V7)) end, fun (V8) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V8)) end, V6)) end, V5))))(V4)) end end end(E0)); {'Idris.Prelude.Types.Left', E1} -> (fun (V9) -> fun (V10) -> {'Idris.Prelude.Types.Nothing'} end end(E1)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--case block in getEscriptPath-1330'(V0, V1, V2) -> case V2 of E0 -> (fun (V3) -> V3 end((fun (V4) -> ('unicode':'characters_to_binary'(V4)) end(E0)))); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'case--getEscriptPath-1312'(V0) -> case V0 of {'Idris.Prelude.Types.Right', E0} -> (fun (V1) -> fun (V2) -> ('Idris.Idris2.Erlang.Decode':'un--erlDecodeMay'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V3) -> ('Idris.Idris2.Erlang.Decode':'dn--un--map_Functor__ErlDecoder'('erased', 'erased', fun (V4) -> case V4 of E1 -> (fun (V5) -> V5 end((fun (V6) -> ('unicode':'characters_to_binary'(V6)) end(E1)))); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end, fun (V7) -> ('Idris.Idris2.Erlang.Decode':'un--charlist'(V7)) end, V3)) end, V1)) end end(E0)); {'Idris.Prelude.Types.Left', E2} -> (fun (V8) -> fun (V9) -> {'Idris.Prelude.Types.Nothing'} end end(E2)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end.
'nested--3391-1660--in--un--zipFile'(V0, V1) -> ('Idris.Idris2.Erlang.Decode':'dn--un--map_Functor__ErlDecoder'('erased', 'erased', fun (V2) -> case V2 of {E0, E1, E2, E3, E4, E5} -> (fun (V3, V4, V5, V6, V7, V8) -> case V4 of E6 -> (fun (V9) -> V9 end((fun (V10) -> ('unicode':'characters_to_binary'(V10)) end(E6)))); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end(E0, E1, E2, E3, E4, E5)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end, fun (V11) -> ('Idris.Idris2.Erlang.Decode':'un--tuple6'('erased', 'erased', 'erased', 'erased', 'erased', 'erased', fun (V12) -> ('Idris.Idris2.Erlang.Decode':'un--exact'('erased', {'Idris.Erlang.Types.ETErlAtom'}, 'zip_file', V12)) end, fun (V13) -> ('Idris.Idris2.Erlang.Decode':'un--charlist'(V13)) end, fun (V14) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V14)) end, fun (V15) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V15)) end, fun (V16) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V16)) end, fun (V17) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V17)) end, V11)) end, V1)).
'nested--3391-1661--in--un--row'(V0, V1) -> ('Idris.Idris2.Erlang.Decode':'dn--un--<|>_Alternative__ErlDecoder'('erased', fun (V2) -> ('Idris.Idris2.Erlang.Decode':'dn--un--map_Functor__ErlDecoder'('erased', 'erased', fun (V3) -> {'Idris.Prelude.Types.Just', V3} end, fun (V4) -> ('nested--3391-1660--in--un--zipFile'(V0, V4)) end, V2)) end, ('Idris.Idris2.Prelude.Interfaces':'un--*>'('erased', 'erased', 'erased', {'Idris.Prelude.Interfaces.dn--un--__mkApplicative', fun (V5) -> fun (V6) -> fun (V7) -> fun (V8) -> fun (V9) -> ('Idris.Idris2.Erlang.Decode':'dn--un--map_Functor__ErlDecoder'('erased', 'erased', V7, V8, V9)) end end end end end, fun (V10) -> fun (V11) -> fun (V12) -> ('Idris.Idris2.Erlang.Decode':'dn--un--pure_Applicative__ErlDecoder'('erased', V11, V12)) end end end, fun (V13) -> fun (V14) -> fun (V15) -> fun (V16) -> fun (V17) -> ('Idris.Idris2.Erlang.Decode':'dn--un--<*>_Applicative__ErlDecoder'('erased', 'erased', V15, V16, V17)) end end end end end}, fun (V18) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V18)) end, fun (V19) -> ('Idris.Idris2.Erlang.Decode':'dn--un--pure_Applicative__ErlDecoder'('erased', {'Idris.Prelude.Types.Nothing'}, V19)) end)), V1)).
'un--readFile'(V0, V1, V2) -> begin (V3 = ('erlang':'apply'('zip', 'zip_get', [('unicode':'characters_to_list'(V1)) | [V0 | []]]))), (('case--readFile-1853'(V0, V1, V3, ('Idris.Idris2.Erlang.Decode':'un--erlDecode'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V4) -> ('Idris.Idris2.Erlang.Decode':'un--okTuple'('erased', fun (V5) -> ('Idris.Idris2.Erlang.Decode':'un--tuple2'('erased', 'erased', fun (V6) -> ('Idris.Idris2.Erlang.Decode':'un--charlist'(V6)) end, fun (V7) -> ('Idris.Idris2.Erlang.Decode':'un--string'(V7)) end, V5)) end, V4)) end, V3))))(V2)) end.
'un--openArchive'(V0, V1) -> begin (V2 = ('erlang':'apply'('escript', 'extract', [('unicode':'characters_to_list'(V0)) | [[] | []]]))), (('case--openArchive-1396'(V0, V2, ('Idris.Idris2.Erlang.Decode':'un--erlDecode'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V3) -> ('Idris.Idris2.Erlang.Decode':'un--okTuple'('erased', fun (V4) -> ('Idris.Idris2.Erlang.Decode':'un--any'(V4)) end, V3)) end, V2))))(V1)) end.
'un--listFiles'(V0, V1) -> begin (V2 = ('erlang':'apply'('zip', 'zip_list_dir', [V0 | []]))), (('case--listFiles-1770'(V0, V2, ('Idris.Idris2.Erlang.Decode':'un--erlDecode'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V3) -> ('Idris.Idris2.Erlang.Decode':'un--okTuple'('erased', fun (V4) -> ('Idris.Idris2.Erlang.Decode':'un--list'('erased', fun (V5) -> ('nested--3391-1661--in--un--row'(V0, V5)) end, V4)) end, V3)) end, V2))))(V1)) end.
'un--getEscriptPath'(V0) -> begin (V29 = (('Idris.Idris2.Erlang.IO':'un--erlTryCatch'('erased', 'erased', {'Idris.Prelude.IO.dn--un--__mkHasIO', {'Idris.Prelude.Interfaces.dn--un--__mkMonad', {'Idris.Prelude.Interfaces.dn--un--__mkApplicative', fun (V1) -> fun (V2) -> fun (V3) -> fun (V4) -> fun (V5) -> ('Idris.Idris2.Prelude.IO':'dn--un--map_Functor__IO'('erased', 'erased', V3, V4, V5)) end end end end end, fun (V6) -> fun (V7) -> fun (V8) -> V7 end end end, fun (V9) -> fun (V10) -> fun (V11) -> fun (V12) -> fun (V13) -> begin (V14 = (V11(V13))), begin (V15 = (V12(V13))), (V14(V15)) end end end end end end end}, fun (V16) -> fun (V17) -> fun (V18) -> fun (V19) -> fun (V20) -> begin (V21 = (V18(V20))), ((V19(V21))(V20)) end end end end end end, fun (V22) -> fun (V23) -> fun (V24) -> begin (V25 = (V23(V24))), (V25(V24)) end end end end}, fun (V26) -> fun (V27) -> V27 end end}, fun (V28) -> ('erlang':'apply'('escript', 'script_name', [])) end))(V0))), case V29 of {'Idris.Prelude.Types.Right', E0} -> (fun (V30) -> ('Idris.Idris2.Erlang.Decode':'un--erlDecodeMay'('erased', 'erased', {'Idris.Erlang.Types.ETErlTerm'}, fun (V31) -> ('Idris.Idris2.Erlang.Decode':'dn--un--map_Functor__ErlDecoder'('erased', 'erased', fun (V32) -> case V32 of E1 -> (fun (V33) -> V33 end((fun (V34) -> ('unicode':'characters_to_binary'(V34)) end(E1)))); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end, fun (V35) -> ('Idris.Idris2.Erlang.Decode':'un--charlist'(V35)) end, V31)) end, V30)) end(E0)); {'Idris.Prelude.Types.Left', E2} -> (fun (V36) -> {'Idris.Prelude.Types.Nothing'} end(E2)); _ -> ('erlang':'throw'("Error: Unreachable branch")) end end.
'un--closeArchive'(V0, V1) -> begin (V2 = ('erlang':'apply'('zip', 'zip_close', [V0 | []]))), {'Idris.Builtin.MkUnit'} end.