Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2268

Closed
Open
Opened May 06, 2008 by guest@trac-guest

ghci "*** Exception: expectJust upseep1"

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.
Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC tora@zonetora.co.uk
Operating system
Architecture
Assignee
Assign to
6.8.3
Milestone
6.8.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#2268