Skip to content

Instantly share code, notes, and snippets.

@lenary

lenary/Main.idr Secret

Created October 26, 2014 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lenary/7abb7ad5d533bf376804 to your computer and use it in GitHub Desktop.
Save lenary/7abb7ad5d533bf376804 to your computer and use it in GitHub Desktop.
module Main
main : IO ()
main = putStrLn "Hello World!"
% Generated by the Idris -> Erlang Compiler.
% Here be dragons.
-module(test).
-compile(export_all).
-compile(nowarn_unused_function).
-compile(nowarn_shadow_vars).
'Main_main'() -> {'U_Prelude_putStr1', "Hello World!\n"}.
'mkForeignPrim'() -> 'nothing'.
'mkLazyForeignPrim'() -> 'nothing'.
'Prelude_putStr'(E0, W0) -> io:put_chars(E0).
'run__IO'(E0) -> 'APPLY0'(E0, 'TheWorld').
'unsafePerformPrimIO'() -> 'nothing'.
'APPLY0'(Fn0, Arg0) -> case Fn0 of
{'U_Prelude_putStr1', P_c0} -> 'Prelude_putStr'(P_c0, Arg0);
_Default -> 'nothing'
end.
'EVAL0'(Arg0) -> case Arg0 of
_Default -> Arg0
end.
'runMain0'() -> 'EVAL0'('APPLY0'('Main_main'(), 'TheWorld')).
'Decidable_Equality_@Decidable_Equality_DecEq$Char:!decEq:0:primitiveNotEq:0'() -> 'nothing'.
'Decidable_Equality_@Decidable_Equality_DecEq$Float:!decEq:0:primitiveNotEq:0'() -> 'nothing'.
'Decidable_Equality_@Decidable_Equality_DecEq$Int:!decEq:0:primitiveNotEq:0'() -> 'nothing'.
'Decidable_Equality_@Decidable_Equality_DecEq$Integer:!decEq:0:primitiveNotEq:0'() -> 'nothing'.
'Decidable_Equality_@Decidable_Equality_DecEq$String:!decEq:0:primitiveNotEq:0'() -> 'nothing'.
'Void_case'() -> 'nothing'.
'Void_elim'() -> 'nothing'.
@lenary
Copy link
Author

lenary commented Oct 26, 2014

Load test.erl up in an erlang shell:

$ erl
...
1> c(test).
... Warnings
{ok,test}
2> test:runMain0().
Hello World!
ok
3>

To escape the erlang shell, Ctrl-G, then q then enter.

@seancribbs
Copy link

That's actually pretty small, considering. Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment