-- This pretends to spot two more bugs in ghc-4.02:

----------------------------------------------------------------------
module Bug where

data R = R {r :: Int}
rr     = R {r=-1}

data Key = K1 | K2 | K3  deriving(Eq)

-- data Mix a = Mix [(Key, c a)]

-- f :: Mix a -> Mix a
-- f    (Mix ps) = case  lookup K1 ps  of  Just _ -> Mix ps
----------------------------------------------------------------------

ghc -c Bug.hs   yields 

 ...:4:10: Haskell 98 does not support 'punning' on records on input: "=-"


Then, replace `=-1' with `= -1',  un-comment the rest of the module and
command
                ghc -c -fglasgow-exts Bug.hs 
It reports
  panic! (the `impossible' happened):
        zonkTcTypeToType: free type variable with non-* type: c{-a144-}


Also i have a question on the language extension:

  is this  Mix a, f  a correct attempt to use existential types?

I mean putting into association list  ps :: Mix Int  
the items like, say, (K1,[0]), (K2,Just 0) - here [], Just  are the
costructor instances for `c' from the Mix definition.


------------------
Sergey Mechveliani
[EMAIL PROTECTED]

Reply via email to