Open TonioGela opened 3 years ago
@noelwelsh shall I close this PR? It hasn't been merged in years and it's probably outdated :)
Please leave it open. I am working on the book, and intend to look at all the open PRs when I get to the relevant sections. I just can't afford to split my focus bouncing around different sections of the book given the limited time I have to work on it.
Please leave it open. I am working on the book, and intend to look at all the open PRs when I get to the relevant sections. I just can't afford to split my focus bouncing around different sections of the book given the limited time I have to work on it.
Thanks @noelwelsh! If you need some kind of help with the book in general just ask ;)
The mailing list at https://www.scalawithcats.com/ is the best place to stay up-to-date. I post there when there is something to announce, and people can access the current draft. Should be posting there tomorrow.
The exercise
4.5.4: Abstracting
asks the reader to write a signature for the methodThe proposed solutions shows the usage of
pure
andraiseError
and uses and if:but since in the chapter the exercises refers to is specified that "Cats provides syntax for
raiseError
andhandleErrorWith
viacats.syntax.applicativeError
andensure
viacats.syntax.monadError
" it makes sense to me to show a solution that uses theensure
API like this:Plus, I personally love oneliners :P