Skip to content

Generalize the type of Data.List.{deleteBy, deleteFirstsBy}

Better (more general) type signatures would be

deleteBy :: (b -> a -> Bool) -> b -> [a] -> [a]
deleteFirstsBy :: (b -> a -> Bool) -> [b] -> [a] -> [a]

Example of why it is useful:

deleteBy ((==) . fst) 1 [(1,'a'), (2, 'b')]
Trac metadata
Trac field Value
Version 6.10.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information