[Haskell-cafe] Thoughts about redesigning "Num" type class

Alexey Muranov 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 
operator.

A common use of "+" is for the operation of an abelian semigroup or monoid 
(any semigroup can be converted into a monoid anyway).

Alexey.

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:
>
> On 11/09/2015, David Thomas <davidle... at gmail.com <javascript:>> wrote: 
> > a subtraction operation that returns a different type 
>
> On 12/09/2015, Alexey Muranov <alexey.... at gmail.com <javascript:>> wrote: 
> > 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...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150912/ba54b74e/attachment.html>


More information about the Haskell-Cafe mailing list