[EMAIL PROTECTED] 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?
--
__( Marcin
Marcin 'Qrczak' Kowalczyk wrote:
[EMAIL PROTECTED] 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
Just spotted this typo:
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 MustBeInt Int
instance Fail a = MustBeInt a
Keean
It is well known that type classes in Haskell are open. A user may at
any time extend a visible type class by providing a new
instance. There are situations where such an extensibility is
undesirable. We may want to prevent the user from adding an instance
to our class for some specific type --