-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Expressing typical map() function #140
Comments
Hi, having a Consider this code: Result<int> ri = Result.Ok(1);
Result<string> rs1 = ri.ToResult(static i => i.ToString());
Result<string> rs2 = ri.Map(static i => i.ToString()); |
Ok, If you come from Haskell, I would suggest to call it |
Yeah, in retrospect, |
Hi guys! First: Second: This functional magic was already discussed in some issues in the past (#132, #108). Please read it. Summary: I don't want to introduce such a complexity in the FluentResults library. |
I have already 2 projects using the The I see @vermiculus can also benefit. I can submit an implementation if you agree. |
How many methods do you think you will add? Can you write down the signatures please so that I get the big picture. Thanks |
public Result<TNewValue> Bind<TNewValue>(Func<TValue, Result<TNewValue>> valueConverter) The name is debatable, since there is the The idea is simple, be able to call functions that take a Additionally, if agreed, the Maybe an alias for |
Please create a pr so that I get the idea. MVP style - let the ToResult(..) stable and don't create a Map alias for them. |
Sorry for the delay. I reviewed the pr and merged it into the master. I will wait for a pr of another issue - by the end of the week I will publish a new version of FluentResults |
New package is out https://www.nuget.org/packages/FluentResults/3.12.0 Thanks for your time inventstment. |
Hi all So, currently there is |
My googling has come up dry, so I thought I'd ask here: is there any implementation of the typical
map()
you would find in other implementations of the result monad? I'm trying to get something closer to LanguageExt's implementation without the apparent expectation that it's being used in LINQ syntax. (Really, all of this is to try to emulate Rust's first-class support for the concept.)Here's an extension method that gets at the syntax I'm looking for, but I can't shake the feeling that I'm working around something that's already available in FluentResults:
used as
I can understand if it's not FluentResult's primary intention to be used as a result monad, but it seems it's very close to having this capability assuming it doesn't have the capability already.
The text was updated successfully, but these errors were encountered: