New to Haskell, I got a version, through Fink, for my Mac OS X. I like the interpreter very much, but I do not see how I may get out of "Prelude" in order to write a program. Could you advise me ? Thanks in advance Jacques van Berchem
J & M van Berchem wrote:
New to Haskell, I got a version, through Fink, for my Mac OS X. I like the interpreter very much, but I do not see how I may get out of "Prelude" in order to write a program.
Use a text editor, then load the file with ":load Foo.hs". You can't type definitions into the hugs/ghci interpreter, just expressions; definitions have to be loaded from a file. [Actually, ghci is slightly more liberal; it also allows let forms (e.g. "let foo = ...") and IO actions (e.g. "foo <- getLine").] -- Glynn Clements <glynn.clements@virgin.net>
participants (2)
-
Glynn Clements -
J & M van Berchem