Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Haskell: Hello World program using runghc command

'runghc' command comes with Haskell distribution, used to run Haskell programs without compiling.

Syntax
runghc [runghc flags] [GHC flags] module [program args]


Use the command 'runghc --help', to get more information about the Command Runghc.
$ runghc --help
Usage: runghc [runghc flags] [GHC flags] module [program args]

The runghc flags are
-f /path/to/ghc Tell runghc where GHC is
--help Print this usage information
--version Print version number


hello_world.hs
main = putStrLn ("hello, world")


$ runghc hello_world.hs
hello, world

It is not necessary to use ‘.hs’ extension after the Haskell file name.    
$ runghc hello_world
hello, world




Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Haskell: Hello World program using runghc command

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×