[Haskell] A puzzle and an annoying feature

Lennart Augustsson lennart at augustsson.net
Thu Nov 25 15:26:32 EST 2004

Daan Leijen wrote:
> You are right, I feel like that too: one should expect that the type
> checker can figure this out, and perhaps it is even really useful.
> On the other hand, suppose you decide later to export the
> class, and suddenly your code would no longer type check.
> The fact that adding an export defintion would lead to a type
> error somewhere else in the code might be rather confusing.
> (worse! it might be considered inelegant :-)

Yes, that is somewhat strange, I agree. :)

> Personally, I feel that this problem might be better solved by
> making a lot of the implicit assumptions (and semantics) of type
> classes more explicit, and bring them under user control. Of course,
> I do have not have any idea of how this should be done concretely ;-)
> (although type class directives might be a step in the right direction?)

Yes, I think the type class directives is a step forwards.  :)

	-- Lennart

More information about the Haskell mailing list