Sjoerd,

> This is not just about map, but it also a problem for the Monoid instance. 
> You are basically adding an extra identity element, 0, to the max monoid, 
> which works but is weird.

Still that's how union is typically defined for hybrid sets. It's what happens 
if want union and empty to behave as generalisations of these concepts for 
ordinary (multi)sets.

> empty' = insert () $ delete () empty
> 
> but:
> 
> empty' <> delete () empty == empty'
> 
> while:
> 
> empty <> delete () empty == delete () empty
> 
> (I couldn't test it as I don't have base 4.5, so I hope I didn't make a 
> mistake here.)

*Data.SignedMultiset> let empty' = insert () $ delete () empty

*Data.SignedMultiset> empty' `union` delete () empty == empty'
False

*Data.SignedMultiset> empty `union` delete () empty == delete () empty
True

Cheers,

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

Reply via email to