Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Bifunctor' functions that automatically work for 'Bifunctor' inside 'Functor' #151

Open
chshersh opened this issue Feb 27, 2018 · 0 comments

Comments

@chshersh
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants