Modulinos: Difference between revisions
Content deleted Content added
Simplified compilation process |
|||
Line 229: | Line 229: | ||
Haskell has scripted main, but getting scripted main to work with compiled scripts is tricky. |
Haskell has scripted main, but getting scripted main to work with compiled scripts is tricky. |
||
<lang sh>$ |
<lang sh>$ runhaskell scriptedmain.hs |
||
Main: The meaning of life is 42 |
|||
⚫ | |||
$ runhaskell test.hs |
|||
Test: The meaning of life is 42 |
|||
⚫ | |||
$ ./scriptedmain |
$ ./scriptedmain |
||
Main: The meaning of life is 42 |
Main: The meaning of life is 42 |
||
$ |
$ ghc -fforce-recomp -o test -main-is Test test.hs scriptedmain.hs |
||
$ ghc -o test -main-is Test test.hs scriptedmain.hs |
|||
$ ./test |
$ ./test |
||
Test: The meaning of life is 42</lang> |
Test: The meaning of life is 42</lang> |
||
scriptedmain. |
scriptedmain.hs |
||
<lang haskell>#!/usr/bin/env runhaskell |
<lang haskell>#!/usr/bin/env runhaskell |
||
Line 244: | Line 246: | ||
-- Compile: |
-- Compile: |
||
-- |
-- |
||
-- |
-- ghc -fforce-recomp -o scriptedmain -main-is ScriptedMain scriptedmain.hs |
||
-- ghc -o scriptedmain -main-is ScriptedMain scriptedmain.hs |
|||
module ScriptedMain where |
module ScriptedMain where |
||
Line 261: | Line 262: | ||
-- Compile: |
-- Compile: |
||
-- |
-- |
||
-- |
-- ghc -fforce-recomp -o test -main-is Test test.hs scriptedmain.hs |
||
-- ghc -o scriptedmain -main-is ScriptedMain scriptedmain.hs |
|||
-- rm scriptedmain.o |
|||
-- ghc -o test -main-is Test test.hs scriptedmain.hs |
|||
module Test where |
module Test where |