[Haskell-beginners] Type classes and synonyms
Stephen Tetley
stephen.tetley at gmail.com
Sat Nov 21 13:13:02 EST 2009
Hi Philip
Aesthetics, taste, sanity, whatever... strongly suggest not doing it of course.
But there is (probably) little harm in trying it.
Best wishes
Stephen
2009/11/21 Philip Scott <haskell-beginners at foo.me.uk>:
>
> Oooh I had no idea you could do that with 'instance'
>
> > instance Num a => Num [a] where
> > (+) = zipWith (+)
> > (-) = zipWith (-)
> > (*) = zipWith (*)
> > fromInteger = repeat . fromInteger
> > abs = map abs
> > signum = map signum
More information about the Beginners
mailing list