Bugs with GADTs in GHC6.4.1

Jeremy Gibbons jeremy.gibbons at comlab.ox.ac.uk
Tue Dec 13 04:46:51 EST 2005


On 12 Dec 2005, at 12:48, Andres Loeh wrote:

>> The attached script induces panic in GHC6.4.1: "ghc-6.4.1: panic! (the
>> `impossible' happened, GHC version 6.4.1): applyTypeToArgs f{v a1Eg}
>> x{v a1Ei}".
>
> I think this is related to a known bug, because the same workaround
> helps -- annotate the "f" and "x" arguments in the last line of your
> program with dummy type variables, and the program will be accepted:
>
>> zap :: Vector n (a -> b) -> Vector n a -> Vector n b
>> zap fs xs = unfoldv f (len fs) (VP (fs, xs)) where
>>   f :: VectorPair (a->b) a (S n) -> (b, VectorPair (a->b) a n)
>>   f (VP (VCons (f :: foo) fs, VCons (x :: bar) xs)) = (f x, VP (fs, 
>> xs))

Thanks, Andres. As you say, that solve the problem.
Jeremy

Jeremy.Gibbons at comlab.ox.ac.uk
   Oxford University Computing Laboratory,    TEL: +44 1865 283508
   Wolfson Building, Parks Road,              FAX: +44 1865 273839
   Oxford OX1 3QD, UK.
   URL: http://www.comlab.ox.ac.uk/oucl/people/jeremy.gibbons.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: transpose4+.lhs
Type: application/octet-stream
Size: 771 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-bugs/attachments/20051213/e3dcd45d/transpose4.obj
-------------- next part --------------



More information about the Glasgow-haskell-bugs mailing list