[Haskell] How to close a type class

Keean Schupke k.schupke at imperial.ac.uk
Fri Nov 12 07:45:30 EST 2004


Marcin 'Qrczak' Kowalczyk wrote:

>oleg at pobox.com writes:
>
>  
>
>>Thus we have reduced the problem of excluding certain types from a
>>typeclass to the problem of excluding all types from one particular
>>typeclass: Fail. How can we prevent the user from adding instances to
>>Fail?
>>    
>>
>
>By not exporting its name?
>
>  
>
Perhaps that should have read:

How can we prevent the user from adding instances to Fail, whilst still exporting
Fail so that it can be used in the constraints of other classes, like:

	class MustBeInt a
	instance MustBeInt a
	instance Fail a => MustBeInt a

Keean.





More information about the Haskell mailing list