
31 Mar
2004
31 Mar
'04
7:09 a.m.
Am Mittwoch, 31. März 2004 13:51 schrieb Henning Thielemann:
[...]
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)
This syntax would also have the advantage that you can apply different contexts to different constructors. Wolfgang