fsprojects / FSharpx.Extras

Functional programming and other utilities from the original "fsharpx" project
https://fsprojects.github.io/FSharpx.Extras/
The Unlicense
682 stars 146 forks source link

It's a bit confusing that Validation uses Choice instead of Result #428

Open Tarmil opened 1 year ago

Tarmil commented 1 year ago

I understand that it's because this library is older than the inclusion of the Result type in FSharp.Core. But maybe it would be worth adding a separate Result-based validation module? Maybe even ultimately obsoleting the current Choice-based one.

gdziadkiewicz commented 1 year ago

I totally agree with that! Let's add a Result-based validation module and deprecated the Choice. In the next major version we can obsolete it. Should I do it or leave it for you?

Tarmil commented 1 year ago

I can work on it.

I'm not sure what the new module should be called though. Validate? Validator? Or maybe still Validation but located in a sub-namespace to avoid collision?

gdziadkiewicz commented 1 year ago

I like the idea of Validation located in a sub-namespace. With such approach I would be able to simply switch to new implementation by change the open in my code and fixing compiler errors.