[Haskell] My brain just exploded

Dominic Steinitz dominic.steinitz at blueyonder.co.uk
Sun May 14 04:03:25 EDT 2006


What a great error message:

qcgadt.hs:115:7:
    My brain just exploded.
    I can't handle pattern bindings for existentially-quantified constructors.
    In the binding group
        (Rep x) = uncompressRep s
    In the definition of `uncompressRep':
        uncompressRep (0 : 1 : 0 : s) = let (Rep x) = uncompressRep s in Rep 
(RList x)
Failed, modules loaded: none.

Here's the offending line:

uncompressRep (0:1:1:s) =
   let (Rep x) = uncompressRep s in
      Rep (RList x)

But this works:

uncompressRep (0:1:0:s) =
   let x = uncompressRep s in
       case x of
          (Rep y) -> Rep (RList y)

Can someone explain this?

Thanks, Dominic.





More information about the Haskell mailing list