How to execute a compiled code snipped in Frege online repl

穿精又带淫゛_ 提交于 2019-12-12 19:01:07

问题


OK, I guess this is a stupid beginners question:

I try to learn Frege through the online repl. For doing so, I though it would be a good idea to paste code examples from Dierk's Real World Frege to the upper right window of the repl, press compile and... ? How do I start this code?


回答1:


I guess I partly found the answer myself:

the :java command in the command line shows the generated code. Within this code, it is visible that the compiled module is automatically imported, so we don't have to reference it.

Now, if we take the HelloWorld example from the repl, it is simply executed by typing

frege> main

into the left window.

Dierk uses for his examples the syntax

main _ = do

If we now type

frege> main

we only get

:: a -> IO ()

as output. But if we type

frege> main "something"

the repl gives the expected output. While I still don't know what's going on, this helps me with my next steps :-)



来源:https://stackoverflow.com/questions/33926012/how-to-execute-a-compiled-code-snipped-in-frege-online-repl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!