[Haskell-cafe] Multi-parameter type class woes
Thomas DuBuisson
thomas.dubuisson at gmail.com
Mon Dec 15 09:21:12 EST 2008
On Mon, Dec 15, 2008 at 2:15 PM, Thomas DuBuisson <
thomas.dubuisson at gmail.com> wrote:
> 2008/12/15 Mario Blazevic <mblazevic at stilo.com>
>
>> Alexander Dunlap wrote:
>>
>>> The problem is that y is not mentioned in the signature of wrapper.
>>> When you call wrapper x, there could be many different instances of
>>> Container x y with the same x, so GHC doesn't know which version to
>>> call.
>>>
>>
>>
>> I guess I see it now. However, if the explicit 'Container x y =>'
>> context couldn't fix the y to use for instantiation of Container x y, I
>> don't see any way to fix it. And if there is no way to call wrapper in any
>> context, the class declaration itself is illegal and GHC should have
>> reported the error much sooner. Should I create a ticket?
>>
>
>
> Please do not create a ticket. Such a typeclass is legitimate, but not
> useful alone or with functional dependencies. It is useful with Type
> Families though, so celebrate!
>
> Thomas
>
Ok, now I get to laugh at myself. Caught up in the type family fun, I
didn't even notice I obliterated the MPTC issue that started the whole
discussion. Slowing down to think, I can't find an example where the
original MPTC is any good and it should thus receive a compile time error.
Perhaps someone will come along and give a legitimate example.
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081215/7d39723d/attachment.htm
More information about the Haskell-Cafe
mailing list