
16 Mar
2004
16 Mar
'04
1:20 p.m.
JP Bernardy
You argued that Eq is (nearly) always assumed to be defined by structural equality, so "Bag" would be just as good as "MultiSet".
I think you're saying we might need a bag to hold items where we want to group things according to (equivalence on) some arbitrary key? Perhaps we could have the bag datatype parametrised over a user-supplied ordering, so that Set a would be equivalent to a Bag compare a (with compare :: a -> a -> Ordering) The bag could then hold regular (Eq-based) Sets of items. Would this make sense? Would it be useful? -kzm -- If I haven't seen further, it is by standing in the footprints of giants