On Apr 23, 2012, at 7:04 PM, Stefan Holdermans wrote:

> if this is what people have agreed on to be a sensible semantics for hybrid 
> sets, I am fine implementing it like this.

I have a hard time believing you have implemented the semantics that people 
have agreed on to be a sensible semantics for hybrid sets.

I would expect that multiplicity k (m `union` n) == multiplicity k m `max` 
multiplicity k n. Which means that an element of m with negative multiplicity 
is not a member of m `union` n if it is not a member of n. So that would mean 
that union would have to be implemented something like this:

SMS m `union` SMS n = SMS $ Map.intersectionWith max m n `Map.union` Map.filter 
(>= 0) ((m Map.\\ n) `Map.union` (n Map.\\ m))

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

Reply via email to