Ticket #2866 (closed bug: duplicate)
panic with GADTs + NoMonomorphismRestriction
Description
The program below causes
ganesh@defoe:~/temp$ ghc -c Test.hs
ghc: panic! (the 'impossible' happened)
(GHC version 6.10.1 for i386-unknown-linux):
initC: srt_lbl
with ghc, and
*Test> E 5
ghc: panic! (the 'impossible' happened)
(GHC version 6.10.1 for i386-unknown-linux):
nameModule xs{v afT}
with ghci
The problem goes away with ghc -O.
{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
module Test where
data Expr a = E Int
deriving Show
data IsSeq a where
IsSeq :: IsSeq [a]
isSeq :: Expr a -> IsSeq a
isSeq = undefined
mkSeq :: [Expr [a]] -> Expr [a]
mkSeq = undefined
unSeq :: Expr [a] -> [Expr [a]]
unSeq = undefined
sequenceEquality :: Expr a -> Expr a
sequenceEquality x = case isSeq x of
IsSeq -> let xs = unSeq x in mkSeq xs
Change History
Note: See
TracTickets for help on using
tickets.
