Ticket #2268 (closed bug: fixed)
ghci "*** Exception: expectJust upseep1"
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.3 |
| Component: | GHCi | Version: | 6.8.2 |
| Keywords: | Cc: | tora@… | |
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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 - tora@colorado:/tmp/GhcBug.hs
>ls
Bookmarks.hs Bookmarks.hs-boot Cursor.hs Simplify.hs
16:56:51 - tora@colorado:/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 - tora@colorado:/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 - tora@colorado:/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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

