You won't need Result in this case if you make impossible state impossible :-)
BTW, have you tried the official Elm documentation? I'm not sure how they hold up for people new to functional programming but I myself found them sufficient (for the fundamentals anyway).
I would argue this isn't a good exercise then. There are better way to explain result, that do not promote improper state representation (such as making a safe division function).
I apologize for being harsh. I understand writing this stuff is time-consuming and sometimes hard, but I do believe this (making impossible state impossible) is an important concept, central to Elm and FP in general.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First, I'm gonna try deal wit the case and then with the Result type and then I will add types.
P.S. I just got my hand on frondendmasters elm courses. I will postpone solving the problem. Want to watch the videos first.
You won't need
Result
in this case if you make impossible state impossible :-)BTW, have you tried the official Elm documentation? I'm not sure how they hold up for people new to functional programming but I myself found them sufficient (for the fundamentals anyway).
The exercise is written such that it expects to get a
Result
.github.com/exercism/elm/blob/maste...
I would argue this isn't a good exercise then. There are better way to explain result, that do not promote improper state representation (such as making a safe division function).
I apologize for being harsh. I understand writing this stuff is time-consuming and sometimes hard, but I do believe this (making impossible state impossible) is an important concept, central to Elm and FP in general.