If you have a script you want to fiddle with, type:
ghci myscript.hsIt will load the script, but not try to run it, even if it defines the main function. You can just type main if you want to run it. Alternately, you can start ghci without any arguments and then type ":l myscript.hs" to load it into ghci.
GHCi has a bunch of single letter commands that are prefixed with a colon. Here are some of them:
:q -- quit :l file -- load a file :t function -- show the type of an expressionYou can type the name of any function to execute it. It is smart enough to execute IO functions properly as well as non-IO functions without any help on your part.
Tom's Computer Info / [email protected]