Suggestion: Add Bind and BindAsync function to the Result<>
See original GitHub issueIt would be nice to add to the library binding of Result<>
public Result<B> Bind<B>(Func<A, Result<B>> f)
public async Task<Result<B>> BindAsync<B>(Func<A, Task<Result<B>>> f)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - How do I bind an async method that returns an Either ...
1 Answer. You're running into problems because not only is Either a monad, asynchronous computations (Tasks) are too. Thus, the Bind method you ......
Read more >Bind Async · Issue #1404 · grpc/grpc-node
After i changed server.bind to bindAsync i am getting TypeError: callback must be a function As a result i passed a function as...
Read more >SAP Fiori: How to bind async loaded model to UI?
How can I use a model that was loaded by an async AJAX request in the UI? What is the approach to load...
Read more >Generating argument expressions for minimal APIs ...
In this post I look at some more expressions that RequestDelegateFactory.CreateArgument() generates to bind minimal API handler parameters.
Read more >Triggers and bindings in Azure Functions
Add a binding by adding its specific definitions to your function. To learn how, see Add bindings to an existing function in Azure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Fin<A>is a synchronous type, so it doesn’t make sense to have anBindAsyncuntil there’s aFinAsync<A>pair (likeEitherAsyncforEitherandOptionAsyncforOption). Yes, it could return aTask<Fin<B>>but that then becomes a future breaking change when I addFinAsync.You might want to consider using
EffandAff- as they are effectively wrappers for functions that returnFin. I guess it depends on your use-case, but they are fully featured and are designed to play nice with each other. You can create success and fail values like so:They are lazy though, so you must call
mx.Run()to get theFinout of it. Outside of that, the other option would be to useEither<Error, A>andEitherAsync<Error, A>That’s true, I’d like to deprecate it at some point. The supported equivalent monad is:
Fin<A>