Haskell 98 Report
Simon Peyton-Jones
simonpj@microsoft.com
Thu, 31 May 2001 00:53:50 -0700
| > | deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
| > |=20
| > | I've found it usefully used at this more general type.
| >=20
| > Indeed, and
| >=20
| > deleteFirstsBy :: (a -> b -> Bool) -> [b] -> [a] -> [b]
|=20
| and
|=20
| intersectBy :: (a -> b -> Bool) -> [a] -> [b] -> [a]
Indeed.
We should either generalise all three
deleteBy
deleteFirstsBy
intersectBy
or none.
In favour:
the more general types are occasionally useful
no programs stop working
Against
it's an unforced change
perhaps some error message may get more obscure
Tom wrote
| That suggests a reason to leave the type of intersectBy alone=20
| - the generalisation would arbitrarily favour the first=20
| list's type over the second list's type. To me, the word=20
| "intersect" implies symmetry.
The point is that you can always use it at the symmetrical type too.
This isn't a big issue, or I would not be considering it at this point.
So I solicit feedback, and will then just decide something.
Simon