Bugs with GADTs in GHC6.4.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bugs with GADTs in GHC6.4.1

Jeremy.Gibbons
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}".

In case it helps to understand what I was trying to do: this was an
attempt to define an unfold for vectors, a number-parametrized type.
(Ross, Bruno: I think the unfold still has to be inductive rather than
coinductive, hence the additional parameter of type Nat n.)

Jeremy

[hidden email]
   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


_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

transpose4+.lhs (784 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bugs with GADTs in GHC6.4.1

Andres Loeh-2
> 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))

Cheers,
  Andres
_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Reply | Threaded
Open this post in threaded view
|

Re: Bugs with GADTs in GHC6.4.1

Jeremy.Gibbons

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

[hidden email]
   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




_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

transpose4+.lhs (799 bytes) Download Attachment