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

Richard O'Keefe ok at cs.otago.ac.nz
Fri Apr 20 01:02:12 CEST 2012

Signed multisets are unfamiliar to most of us, and I for one
found the paper a little fast-paced.  Can you put a bit more
into the documentation?  Just for starters, I found it
confusing when the documentation talks about "an element with
multiplicity zero", because in the _paper_ a value that has
multiplicity zero in an mzset is NOT an element of it.

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 think anyone is going to be confused that a non-empty
mzset can have 'cardinality' 0, so a little more reassurance
that cardinality/=size is intentional might not go amiss.
Perhaps an additional name such as totalMultiplicity could
make things a little easier for writers and readers, even
though cardinality is correct.

Are you _sure_ that the definitions of isSubmultisetOf and
isProperSubmultisetOf are correct?  Proper sub<thing> is
normally taken as requiring that only *one* member of the
larger collection occur strictly fewer times in the smaller;
here you require that for *all*.

At least once, "multiplicities" is spelled "multiplicites".

More information about the Haskell-Cafe mailing list