简体   繁体   中英

How to execute a compiled code snipped in Frege online repl

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?

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 :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM