Re: [Haskell] How to close a type class

2004-11-12 Thread Marcin 'Qrczak' Kowalczyk
[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

Re: [Haskell] How to close a type class

2004-11-12 Thread Keean Schupke
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

Re: [Haskell] How to close a type class

2004-11-12 Thread Keean Schupke
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

[Haskell] How to close a type class

2004-11-11 Thread oleg
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 --