[Haskell-cafe] Adding Ord constraint to instance Monad Set?
Henning Thielemann
iakd0 at clusterf.urz.uni-halle.de
Wed Mar 31 13:51:10 EST 2004
On Wed, 31 Mar 2004, MR K P SCHUPKE wrote:
> | "Constraints on datatype declarations are a misfeature of Haskell, and
> | have no useful effect."
> |=20
> | Is this the final conclusion?
>
> >Yes, it is, I believe. Constraints on data type declarations are a
> >mis-feature. I tried to get them removed, but there was some argument
> >that they could be made useful
>
> Might I try and pursuade you that mis-feature is a bit strong.
>
> A data type declaration creates two things - the data type itself
> and the constructor function.
>
> If you consider the constrains in the data type declaration to
> apply only to the constructor then it all makes sense.
If this is the meaning then in my opinion the syntax is misleading and it
should be instead like
data Either a b =
(Ord a) => Left a
| (Num b) => Right b
(just a fictive example)
More information about the Haskell-Cafe
mailing list