[Haskell-cafe] Thoughts about redesigning "Num" type class
alexey.muranov at gmail.com
Sat Sep 12 09:11:26 UTC 2015
Maybe it is unreasonable to look for maximal generality in use of each
A common use of "+" is for the operation of an abelian semigroup or monoid
(any semigroup can be converted into a monoid anyway).
P.S. I was tempted to suggest "++" for cancellative monoids and "**" for
arbitrary monoids, but "++" on lists is not quite cancellative if one of
the lists is infinite.
On Saturday, September 12, 2015 at 10:52:01 AM UTC+2, M Farkas-Dyck wrote:
> > a subtraction operation that returns a different type
> > My 2 cents: the difference of two points in an affine space is a vector,
> > the sum of a point of an affine space and a vector is another point.
> This would mean multi-parametre type classes or type families, so we'd
> need to canonicalize them first, which seems unlikely in near future
> at least.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe