Unexpected NoImplicitPrelude behaviour in GHCi (bug?)

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Jun 10 23:10:14 EDT 2010


On Jun 10, 2010, at 05:59 , Philip K.F. Hölzenspies wrote:
> [holzensp at ewi1043:work/FPPrac]% ghci BugDemo.hs
> GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> Loading package ffi-1.0 ... linking ... done.
> [1 of 1] Compiling BugDemo          ( BugDemo.hs, interpreted )
> Ok, modules loaded: BugDemo.
> *BugDemo> 5
> 5
> *BugDemo> :t 5
> 5 :: (P.Num t) => t
> *BugDemo> :q
> Leaving GHCi.
> [holzensp at ewi1043:work/FPPrac]% ghci -fno-implicit-prelude BugDemo.hs
> GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> Loading package ffi-1.0 ... linking ... done.
> [1 of 1] Compiling BugDemo          ( BugDemo.hs, interpreted )
>
> on the commandline:
>    Warning: -fno-implicit-prelude is deprecated: use
> -XNoImplicitPrelude or pragma {-# LANGUAGE NoImplicitPrelude #-}  
> instead
> Ok, modules loaded: BugDemo.
> *BugDemo> 5
>
> <interactive>:1:0: Not in scope: `>>'

This doesn't surprise me; when putting it in the module, it affects  
only that module.  When using either command line version, it affects  
*everything*... and what's breaking is not your definition of  Number,  
but the ghci expression printer (which, being in IO, is doing  
something like (print it >> putStr "\n").  Since the command line  
option has global effect, the Prelude's (>>) isn't defined for ghci's  
guts either.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20100610/ed687df8/PGP.bin


More information about the Glasgow-haskell-users mailing list