-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
EitherUnsafe MapLeft throws ResultIsNullException #1225
Comments
Out of curiosity, what is the purpose in using a null in this use-case? How I have been taught, null should be avoided as much as possible when it comes to FP. |
Actually I stumbled upon it while doing something like
|
Well from looking at the source code, this is an intended behavior if I am not mistaken. |
EitherUnsafe supports null (that's the 'unsafe' aspect of it), so this sounds like a bug. I'll take a look over the weekend. The other comments about avoiding null is worth considering, either make the Right have a 'zero' state, or consider making null into a Left error state. It's much better to be intentional with your type definitions than to have an 'undefined' state. |
Hi,
I'm a new user of this library and trying to integrate it into some of my projects.
Now I stumbled upon a behavior which I don't understand and I'm wondering whether this is a bug:
This code throws a
ResultIsNullException
on my system using LanguageExt v4.4.3:RightUnsafe<Exception, object>(null).MapLeft(ex => ex);
Why is MapLeft() throwing here?
The text was updated successfully, but these errors were encountered: