Dannyu NDos
2018-11-01 02:53:03 UTC
I've suffered from inconvenience due to the restricted type signature. I'll
be very glad if such restrictions are lifted:
deleteBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> a -> [b] -> [b]
deleteFirstsBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> [a] -> [b] -> [b]
intersectBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> [a] -> [b] -> [a]
I approve these versions because:
1. It makes more sense that the "usual" `delete` and `intersect` functions
are specialization of the "By" operations, not the vice versa.
2. Data.Map.Lazy module from *containers* package has these kind of "By"
operations.
The previous discussion about this in Sep 2016 didn't make much conclusion,
so let the discussion continue.
be very glad if such restrictions are lifted:
deleteBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> a -> [b] -> [b]
deleteFirstsBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> [a] -> [b] -> [b]
intersectBy :: (a -> b -> Bool
<http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Bool.html#t:Bool>)
-> [a] -> [b] -> [a]
I approve these versions because:
1. It makes more sense that the "usual" `delete` and `intersect` functions
are specialization of the "By" operations, not the vice versa.
2. Data.Map.Lazy module from *containers* package has these kind of "By"
operations.
The previous discussion about this in Sep 2016 didn't make much conclusion,
so let the discussion continue.