[Haskell] A puzzle and an annoying feature

Lennart Augustsson lennart at augustsson.net
Thu Nov 25 13:11:03 EST 2004


Daan Leijen wrote:
> Keean Schupke wrote:
> 
>> No, closed classes are different, here we are talking about lazy 
>> overlap resolution, so
>> if at _call_ time only one instance fits we choose it. Closing a class 
>> is different.
> 
> 
> A "closed class" directive however is an explicit specification that
> makes the intention of the designer explicit in the program. Since
> it would solve the puzzle in a rather elegant and explicit way, I
> thought that it was interesting to mention.
> 

Indeed, a closed directive would have been fine.  But it's not really
necessary, the class is obviously closed because of not being exported.
But the type checker doesn't use this fact.
I find it somewhat anomalous that there is one unique way to give types
to my program, but that the type checker refuses to do it. :)

	-- Lennart


More information about the Haskell mailing list