constructor classes in StdEnv
Martin Wierich
martinw@cs.kun.nl
Tue, 01 Feb 2000 18:16:14 +0100
Hi Erik,
We decided the following: The StdEnv should not grow too big. For further
definitions that should be shared between libraries or applications we will
introduce a library called "StdLib" that is allowed grow. There is a plan to
include your mentioned classes. StdLib will be also the place for definitions
like the "Maybe" type. We are open for proposals (but the StdLib has not a high
priority in our list of things to do).
Not overloading the map function has the advantage that beginners will not be
confronted with complicated types and complicated error messages.
greetings
Martin Wierich
University of Nijmegen
"Zuurbier, E. - AMSXE" wrote:
> Are there any plans to introduce type constructor classes like the following
> in the StdEnv?
>
> class map c :: (a -> b) (c a) -> (c b)
> instance map [] ...
> instance map {} ...
> instance map Tree ...
>
> class size c :: (c a) -> Int
> instance size [] ...
> instance size {} ...
> instance size Tree ...
>
> Particularly the latter one would relieve me from the burden of determining
> whether I should use length [1,2,3]
> or size [1,2,3], and length {1,2,3} or size {1,2,3}
>
> Regards
> Erik Zuurbier