Open christophercalm opened 2 months ago
We're trying to keep naming consistent in this library. In the earlier days there were discussions on which naming approach to choose: the C# one (Select
, SelectMany
, etc) or the F# one (Map
, 'Bind', etc). We decided to follow the F# naming convention because it's more consistent (e.g SelectMany
doesn't really make sense for Result
and even for Maybe
).
So all Select
extensions remaining should really be marked as obsolete and redirected to Map
.
The downside to this decision is that Linq expressions (from ... in ... select
) won't work anymore, but people rarely use those. And I suggest to just use regular linq instead.
The reason for using linq expressions is that you can combine results from many different monads. You can’t do that with the regular linq syntax without multiple select many expressions. I would ask that you please reconsider as the rest of the api is complete in regards to the overloads for linq query expressions.
OK, makes sense. Feel free to submit a PR. A couple of implementation notes:
Select
should call Map
internally; SelectMany
-- Bind
(just so that we don't have duplicate implementations)Select
and SelectMany
-- to support linq expressionsOK, makes sense. Feel free to submit a PR. A couple of implementation notes:
Select
should callMap
internally;SelectMany
--Bind
(just so that we don't have duplicate implementations)- Please leave a note as to why we have
Select
andSelectMany
-- to support linq expressions
That has been done in this commit.
Would you be able to raise a PR for this commit? Just select your branch here: https://github.com/vkhorikov/CSharpFunctionalExtensions/compare and hit "Create pull request"
Would you be able to raise a PR for this commit? Just select your branch here: https://github.com/vkhorikov/CSharpFunctionalExtensions/compare and hit "Create pull request"
I have one here. :)
https://github.com/vkhorikov/CSharpFunctionalExtensions/pull/567
Sorry for the delay. Merging, will be published soon.
Is the Select method not supported for linq query syntax for result?
As an example here is code that works with
Maybe
But does not work with Result
This is the error: CS1936 Could not find an implementation of the query pattern for source type 'Result'. 'Select' not found.
I see the that SelectMany operation is supported but it looks like there is no select. Is this something that you would be open to me adding?
It would help with workflows like this
but for results.