Replies: 3 comments
-
|
Instead of doing a second bind, you could just use a Map instead, and that works for me. Hard to tell what the end-goal you are going for without more specifics honestly. Hope this helps, and let me know if it works. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply. I'll need to remember where I was doing this, and what I was trying to do now! I'll see if I can get it working and let you know. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
|
The core reason the compiler couldn't infer your types is that a In order to Here's an example: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I may be doing this completely wrong, so please be patient with me!
I have a set of methods that return
TryAsync<T>(very simplified for clarity)......which I bind together as follows (again, very simplified for clarity)...
This all works fine, but I now want to call a method that returns a
Task<Either<string, Unit>>from inside the first lambda inMatch. I can do it like this...However, this seems wrong, as I think I should be able to bind the methods together. However, I'm not sure how to do this. I tried the obvious...
...but this gave a compiler error on the second
Bindsaying The type arguments for method 'TryAsyncExtensions.Bind<A, B>(TryAsync, Func<A, TryAsync>)' cannot be inferred from the usage.Anyone able to advise? Thanks
Beta Was this translation helpful? Give feedback.
All reactions