sanctuary-js / sanctuary

:see_no_evil: Refuge from unsafe JavaScript
https://sanctuary.js.org
MIT License
3.04k stars 94 forks source link

add Either.mapLeft #476

Closed adrian-gierakowski closed 6 years ago

adrian-gierakowski commented 6 years ago

equivalent to:

S.bimap( S.__, S.I )

trivial but handy

davidchambers commented 6 years ago

Good idea. I think the type would be Bifunctor f => (a -> b) -> f a c -> f b c.

Are you interested in submitting a pull request, @adrian-gierakowski? If so, please submit it to sanctuary-type-classes. The function will then make its way into Sanctuary itself in due course. :)

adrian-gierakowski commented 6 years ago

@davidchambers thank you for adding this, and appologies for not submitting a PR myself but I haven't noticed your initial reply and forgot about the issue :)

davidchambers commented 6 years ago

No problem, @adrian-gierakowski. Thanks for being the catalyst. :)