DEV Community

Discussion on: Elm challenge on Exercism: Rna Transcription

Collapse
 
antonrich profile image
Anton • Edited

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.

Collapse
 
drbearhands profile image
DrBearhands

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).

Thread Thread
 
stevensonmt profile image
stevensonmt

The exercise is written such that it expects to get a Result.
github.com/exercism/elm/blob/maste...

Thread Thread
 
drbearhands profile image
DrBearhands • Edited

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.