GHC 6.10.2 the 'impossible' panic with type families

Jan Jakubuv jakubuv at
Tue May 5 06:06:25 EDT 2009

Dear haskellers,

with the following code:

    {-# OPTIONS -fglasgow-exts #-}    

    class SUBST s where
        type STerm s

    class OBJECT o where
        type OTerm o
        apply :: (SUBST s, OTerm o ~ STerm s) => s -> o 

    fce' f = fce . apply $ f 

    fce f = fce' f 

I have the following message in both GHCi and GHC (tested on GHC 6.10.1
linux and win, and 6.10.2 linux):

    ghc: panic! (the 'impossible' happened)
      (GHC version 6.10.2 for i386-unknown-linux):
            idInfo co{v agz} [tv]

    Please report this as a GHC bug:

The above is the smallest example I have found that behaves in this way. It
is a striped version of an original and more complicated code. What seems
interesting to me is that when one defines `fce` as follows (instead of the

   fce = fce'

then everything is ok (= no panic message). In my original code `fce'` was a
monad computation, something like:

    fce' f = fce f >>= \s → fce (apply s)

and this produces the same result (= the panic message).

Is this a bug or a known issue?


Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

More information about the Glasgow-haskell-users mailing list