I'm trying to write a function with the following type-signature using lenses, but staring blankly at filtered
is apparently not working!
modifyElem
:: (a -> Bool) -- predicate function
-> (a -> a) -- modification to apply
-> [a]
-> [a]
If possible, this could also be generalised further to the following:
modifyElem
:: (Foldable t) -- or (Traversable t)
-> (a -> Bool)
-> (a -> a)
-> t a
-> t a