ghc-6.4: panic!

Thurston Hou Yeen Dang thyd101 at cse.unsw.EDU.AU
Thu Apr 27 01:35:41 EDT 2006


Hello,

The following code:
-----
data Tree a = Leaf | Node a Tree Tree

double :: Tree Int -> Tree Int
double Leaf
     = Node 1 Leaf Leaf
double (Node myKey leftTree rightTree)
     = Node myKey (double leftTree) (double rightTree)
-----
caused an error message:
-----
ghc-6.4: panic! (the `impossible' happened, GHC version 6.4):
         Unify.unifyTauTyLists: mismatched type lists!

Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.
-----

The desired code (without polymorphic types) can be achieved without 
error using:
-----
data Tree = Leaf | Node Int Tree Tree

double :: Tree -> Tree
double Leaf
     = Node 1 Leaf Leaf
double (Node myKey leftTree rightTree)
     = Node myKey (double leftTree) (double rightTree)
-----

Regards,
  Thurston



More information about the Glasgow-haskell-bugs mailing list