TCMonad:723 bug

Sengan.Baring-Gould at nsc.com Sengan.Baring-Gould at nsc.com
Fri Aug 23 17:59:39 EDT 2002


ghci -fglasgow-exts -syslib data x.lhs 
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 5.00.2, For Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package std ... linking ... done.
Loading package lang ... linking ... done.
Loading package concurrent ... linking ... done.
Loading package posix ... linking ... done.
Loading package util ... linking ... done.
Loading package data ... linking ... done.
Compiling Main             ( x.lhs, interpreted )

x.lhs:5:
    Could not deduce `Ord x' from the context ()
    Probable fix:
        Add `Ord x' to the type signature(s) for {applyElt}
    arising from use of `elt' at x.lhs:5
    In the second argument of `($)', namely `elt fact'
    In the record update: fact {elt = f $ (elt fact)}

x.lhs:5:
    Could not deduce `Ord y' from the context ()
    Probable fix:
        Add `Ord y' to the type signature(s) for {applyElt}
    arising fromghc-5.00.2: panic! (the `impossible' happened, GHC version 5.00.2):
        typecheck/TcMonad.lhs:723: Non-exhaustive patterns in function pp_orig


Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.



Source:

> data (Eq x, Ord x) =>
>      Fact x   = Fact { elt :: x, causes :: [FactID] } deriving (Eq, Ord)

> applyElt        :: (x -> y) -> Fact x -> Fact y
> applyElt f fact  = fact { elt = f $ elt fact }


> main = main
> type FactID = Int



-----------------------
Moore's Law, the more transistors, the more Gates




More information about the Glasgow-haskell-bugs mailing list