[Haskell-cafe] Re: Ambiguous type with PolymorphicComponents
Maurício
briqueabraque at yahoo.com
Sat Mar 7 15:48:25 EST 2009
>> (...)
> When you have
>
> data Test = Test (forall w. (C1 w, C2 w, ..., Cn w) => w)
>
> and
>
> function (Test w) = classmethod w,
>
> there is no way to decide which instance to use, hence the type variable is
> ambiguous.
> (...)
But, then, how can I reach the data inside a
polymorphic component? Or, better, what can I
do with it? If I say:
function (Test w) = classmethod (w :: specificType)
then I have to suppose that w is always of
'specificType', and this may not be true.
Thanks,
Maurício
More information about the Haskell-Cafe
mailing list