Opened 12 years ago

Closed 12 years ago

Last modified 47 years ago

#271 closed bug (Fixed)

panic with GADTs

Reported by: nobody Owned by: simonpj
Priority: high Milestone:
Component: Compiler Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Version : 6.3 (cvs snapshot)
OS : Mac OS X 10.3.6


$ ghc -fglasgow-exts -c Tdpe.hs
ghc-6.3: panic! (the `impossible' happened, GHC version 6.3):
        applyTypeToArgs v{v s1c3} sat_s1c2{v}

Please report it as a compiler bug to glasgow-haskell-,

"Tdpe.hs" is following:

module Tdpe where

infixr |->
data Type t where
    TBase :: Type Base
    TFun  :: Type a -> Type b -> Type (a -> b)
(|->) = TFun

b :: Type Base
b = TBase

newtype Base = In { out :: Term Base }

data Term t where
    App :: Term (a->b) -> Term a -> Term b
    Fun :: (Term a -> Term b) -> Term (a->b)

reify :: Type t -> t -> Term t
reify (TBase) v    = out v
reify (TFun a b) v = Fun (\x -> reify b (v (reflect a x)))

reflect :: Type t -> Term t -> t
reflect (TBase) e    = In e
reflect (TFun a b) e = \x -> reflect b (App e (reify a x))

Change History (2)

comment:1 Changed 12 years ago by simonpj

Logged In: YES 

Fixed (at last).  Thanks for a fine bug report.
Test is th/tdpe.hs

comment:2 Changed 12 years ago by simonpj

Status: assignedclosed
Note: See TracTickets for help on using tickets.