Darren Duncan schreef: > TSa: >> And I still think that it is a good idea >> to name the set operations after their equivalent boolean >> connectives: >> >> (|) union >> (&) intersection >> (^) symmetric difference >> >> Well, and to make them Bag operations to start with.
> To start off with, I agree with your comment about making Set the > main type and making Bag an extension built upon that, as complex is > built upon num, etc. I don't think that will work out. Modification of a Set is more complex than modification of a Bag, so in that sense the Bag is the main type. > This may be a non-issue from a user's viewpoint, but as a user, I > want set operations that have sets as input to return sets as output > by default. Eg, unioning 2 Set that have common values should return > a Set. Or base it on what the receiving end wants. > I see the matter as being similar to Int vs Num. Any operation whose > operands are Ints should return Ints wherever it is conceivable to do > so. In particular, this means that dividing an Int by an Int should > return an Int. Int three = 3 ; Int four = 4 ; Num n1 = three / four ; Num n2 = 3 / 4 ; (Is "Int three" the same as "my Int three"? I hope so.) -- Groet, Ruud