Hans Aberg wrote:
For example, in Map String Integer (sparse representation of monomials) compute the minimum value of all associative pairs with the same key (the gcd); if only one key is present, the absent should be treated as having value 0. So
  unionWith min xs ys
will not work, because unionWith will always apply the identity to the remaining value when one key is missing, whereas it should be sent to 0.

If missing keys represent 0, then wouldn't this work?

    intersectionWith min xs ys


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

Reply via email to