Johannes,

>> This package provides an efficient implementation of so-called
>> signed multisets, which generalise multisets by allowing for
>> negative membership.

> SignedMultiset a = Data.Map.Map a Integer

Indeed.

> so what do I gain by using your library?
> (what is the API difference?)

The library essentially provides some abstractions for recurring patterns when 
interpreting maps from elements to integers as signed multisets or free abelian 
groups: cardinality, union, additiveUnion, intersection, difference. 
Additionally it provides dedicated parsing and pretty printing utilities.

It's just like Data.Set provides abstractions from the patterns that arise when 
interpreting values of type Data.Map.Map a Bool (for an element type a) as sets.

> I sometimes find I want a type "Map with default"
> (the default value is stored when the Map is constructed,
> and you never put keys in there that map to this default).

You could think of SignedMultiset as an instantiation of that type (i.e., the 
one obtained by fixing the default to 0.

HTH,

  Stefan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to