jack-pappas / ExtCore

An extended core library for F#.
Apache License 2.0
178 stars 32 forks source link

Supporting Result and/or Choice #48

Open jack-pappas opened 5 years ago

jack-pappas commented 5 years ago

For ExtCore v1.0 -- should we support both the Result<_,_> and Choice<_,_> type for error-handling, or should we drop Choice<_,_> and use only Result<_,_>?

Pros/cons of supporting Result<_,_> only:

Pros/cons of supporting Result<_,_> and Choice<_,_>:

cc @vasily-kirichenko @7sharp9 @wallymathieu @dsyme @tihan

wallymathieu commented 5 years ago

I've seen some non trivial code that still uses Choice, for instance Suave.

Question is how much of your own effort you want to spend (to support backwards compatibility)?

wallymathieu commented 5 years ago

I think that perhaps @vasily-kirichenko has the most experience using a dual Result<,> Choice<,> ExtCore. Though I remember that there was a lot of code (in that PR) in order to support that solution. For f#+ @gusty opted to start out with changing Choice<,> to Result<,> and then re-add Choice<,> based error handling with new name to support interop with libraries that still use Choice<,>.

Perhaps a compatibility method Result.OfChoice and a smaller set of combined builders could be used to limit the need for support?

vasily-kirichenko commented 5 years ago

@wallymathieu yes, I just pulled your PR, built a nuget package and have used it (Choice and Result are both there) on production with zero problems. So, I'm for just merge that PR.