Closed perfectmak closed 6 months ago
Hello! This is not intended, the behaviour should be the same and map/mapLeft are the correct ones. In fact, this is a bugfix that was made for map but I forgot to change bimap 😅
I welcome any incoming PRs for this, otherwise I will fix it myself at the start of the next year.
I have some downtime this weekend and I'll work on a fix and open a PR.
I just opened a PR #680 to fix this issue. Let me know what you think.
I recently encountered a difference in the behaviour of the
bimap
function when applying transformations functions that return a Promise/PromiseLike type.mapLeft
will await the result of a promise and lift that value into the resulting EitherAsync, while bimap lifts default promise without awaiting it.Here is a sample code to test this out:
This will messages similar to:
I'm happy to contribute a solution to this behaviour but want to know if this is intended.