ramda-adjunct
ramda-adjunct copied to clipboard
bimap - Bifunctor
Is your feature request related to a problem? Please describe.
Static function which support fantasy/land bifunctor specification or calls a bimap
method on provided value. If fantasy/land specification cannot be found, nor bimap
method exists, we should return original value.
Describe the solution you'd like
const left = Monet.Either.Left(1);
const right = Monet.Either.Right(1);
RA.bimap(i => i + 1, i => i + 2, left); // Left(2)
RA.bimap(i => i + 1, i => i + 2, right); // Right(3)
Describe alternatives you've considered
--
Additional context
Monet - https://monet.github.io/monet.js/ Bifunctor specification: https://github.com/fantasyland/fantasy-land#bifunctor
@EarthyOrange can you pls verify this issue ? Thank you!