newtype deriving panic

Dean Herington heringto at cs.unc.edu
Wed Jan 22 16:45:09 EST 2003


Given this program:

{-# OPTIONS -fglasgow-exts #-}

module Bug1 where

import Control.Monad.State

newtype T a = T (StateT Int IO a) deriving (MonadState)


GHC 5.04.2 chokes:

ghc-5.04.2: chasing modules from: Bug1
Compiling Bug1             ( Bug1.hs, ./Bug1.o )
ghc-5.04.2: panic! (the `impossible' happened, GHC version 5.04.2):
        basicTypes/VarEnv.lhs:173: Non-exhaustive patterns in case


Of course, the program is in error.  (It should derive `MonadState Int`.)





More information about the Glasgow-haskell-bugs mailing list