Sometimes it's convenient to map bimap and related functions inside some Functor. For example, if your data base returns Either inside IO. It might be slightly les convenient to write fmap . first f. So I propose to add these functions:
bimapF :: (Functor f, Bifunctor p) => (a -> c) -> (b -> d) -> f (p a b) -> f (p c d)
firstF :: ... similar
secondF :: ... similar
I feel that serokell-util might be a better place for such functions. But names are unambiguos so let's see what others think.
Sometimes it's convenient to map
bimap
and related functions inside someFunctor
. For example, if your data base returnsEither
insideIO
. It might be slightly les convenient to writefmap . first f
. So I propose to add these functions:I feel that
serokell-util
might be a better place for such functions. But names are unambiguos so let's see what others think.