#2268: ghci "*** Exception: expectJust upseep1"
-------------------------------+--------------------------------------------
    Reporter:  guest           |       Owner:        
        Type:  bug             |      Status:  new   
    Priority:  normal          |   Component:  GHCi  
     Version:  6.8.2           |    Severity:  normal
    Keywords:                  |    Testcase:        
Architecture:  x86_64 (amd64)  |          Os:  Linux 
-------------------------------+--------------------------------------------
 ghci gets confused, reporting "*** Exception: expectJust upseep1". I think
 it's related to having pre-compiled source files that cyclicly import each
 other, but havn't double checked/proven it.

 Trace to reproduce the bug here: (notice that at the start Simplify.hs has
 a bug in it, and after loading it, but before doing :!cat Simplify.hs I
 have fixed the error in Simplify.hs)

 {{{
 16:56:38 - [EMAIL PROTECTED]:/tmp/GhcBug.hs
 >ls
 Bookmarks.hs  Bookmarks.hs-boot  Cursor.hs  Simplify.hs

 16:56:51 - [EMAIL PROTECTED]:/tmp/GhcBug.hs
 >ghc --make -c Cursor.hs Bookmarks.hs
 [1 of 3] Compiling Bookmarks[boot]  ( Bookmarks.hs-boot, Bookmarks.o-boot
 )
 [2 of 3] Compiling Cursor           ( Cursor.hs, Cursor.o )
 [3 of 3] Compiling Bookmarks        ( Bookmarks.hs, Bookmarks.o )

 16:57:05 - [EMAIL PROTECTED]:/tmp/GhcBug.hs
 >cat Simplify.hs
 module HExp.Simplify where

 import Cursor(Cursor)

 iterateMaybe :: (a -> Maybe a) -> a -> [a]
 iterateMaybe f init = init : maybe [] (iterateMaybe) (f init)


 16:57:20 - [EMAIL PROTECTED]:/tmp/GhcBug.hs
 >ghci Simplify.hs
 GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
 Loading package base ... linking ... done.
 [3 of 4] Compiling HExp.Simplify    ( Simplify.hs, interpreted )

 Simplify.hs:6:39:
     Couldn't match expected type `[a]'
            against inferred type `a1 -> [a1]'
     Probable cause: `iterateMaybe' is applied to too few arguments
     In the second argument of `maybe', namely `(iterateMaybe)'
     In the second argument of `(:)', namely
         `maybe [] (iterateMaybe) (f init)'
 Failed, modules loaded: Cursor, Bookmarks, Bookmarks.
 Prelude Bookmarks> :!cat Simplify.hs
 module HExp.Simplify where

 import Cursor(Cursor)

 iterateMaybe :: (a -> Maybe a) -> a -> [a]
 iterateMaybe f init = init : maybe [] (iterateMaybe f) (f init)

 Prelude Bookmarks> :r
 *** Exception: expectJust upseep1
 > Leaving GHCi.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2268>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to