[Haskell-cafe] ANN: signed-multiset-0.1

Stefan Holdermans stefan at vectorfabrics.com
Mon Apr 23 14:07:41 CEST 2012


Sjoerd,

>>>> For a specific example, I haven't the faintest intuition about
>>>> what 'map' should do.  Suppose we have
>>>> 	{(k1)x1, (k2)x2}
>>>> and f x1 == f x2 = y.  Should the value of map f {...} be
>>>> {(k1+k2)y} or {(k1`max`k2)y} or what?

> I don't think max would be a good choice, as that would mean that the default multiplicity would have to be negative infinity (the identity element of max) instead of 0, and then using Int as the type for multiplicity would not cut it.

Why would one need such an identity element for map?

Note that the monoidal structure isn't defined over the "maximum of multiplicites" but over the "maximum of *nonzero* multiplicites". (For ordinary sets and ordinary multisets these operations happen to coincide.)

Cheers,

  Stefan



More information about the Haskell-Cafe mailing list