[Haskell-cafe] Re: Weird ghci behaviour?

Claus Reinke claus.reinke at talk21.com
Tue Nov 13 13:58:54 EST 2007


> Granted, I'm lazy. I read release notes only and only few first pages
> to see what's new. Couldn't GHCI be improved to at least give some
> hints?

it does!-) watch the prompt, which says '*M>', if all of M's top-level
is in scope, or 'M>', if only M's exports are in scope. check here:

http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html#ghci-scope

claus

-------------------------
notice how in this example session, the ghci prompt before
compilation is '*Main>', whereas it is 'Prelude Main>' after
compilation (ghci adds the Prelude because otherwise only
'main' would be in scope):
-------------------------
$ ghcii.sh u.hs
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( u.hs, interpreted )
Ok, modules loaded: Main.
*Main> :q
Leaving GHCi.

$ ghc --make u
[1 of 1] Compiling Main             ( u.hs, u.o )
Linking u.exe ...

$ ghcii.sh u.hs
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Ok, modules loaded: Main.
Prelude Main> :q
Leaving GHCi.




More information about the Haskell-Cafe mailing list