MovnaTeam / movna

Open-source training application.
GNU General Public License v3.0
0 stars 1 forks source link

Replaced Either by Result #17

Closed BriceCroix closed 1 year ago

BriceCroix commented 1 year ago

This allows to be more explicit about return types in repositories and usecases. But as the type Failure exists in the library result_type, our own Failure had to be renamed to Fault, any better name is welcome, as I did not want to write an abbreviation such as Err or Fail.

ronw98 commented 1 year ago

I'm just taking a look at synonyms of failure or errors and I genuinely think that Sin if the perfect word for it.

ronw98 commented 1 year ago

you are going to hate me but I think this package is better and more complete than the one you used. The good news is it is very similar to the one you used so changing is not really difficult here.

But i particularly like the extension methods toFailure toSuccess, the Unit type and the rich documentation

BriceCroix commented 1 year ago

I hate that you could not be more right (righter ?). This package is exactly what we need, I also like the AsyncResult, that simplifies writing Future<Result<T,E>>. Besides with a little luck I may be able to rename Fault to Failure, it was way more accurate.

Sin ? really ? xD

ronw98 commented 1 year ago

nope, the result subclasse sare still Failure and Success

but yes, I am dead serious about Sin, it works great and it's fun

BriceCroix commented 1 year ago

I actually quite like Fault after all, but I did not even think about Issue, I may go with that if you agree

BriceCroix commented 1 year ago

There you go ! Ready to merge !