|
|
|
|
|
by fbonetti
3246 days ago
|
|
> Elm's type system will not catch this bug at compile time This is completely false. Elm's type system will force you to handle the decoding failure at compile time. The `decodeString` function has the following type: decodeString : Decoder a -> String -> Result String a
Which means that when you call `decodeString`, it will return a Result containing either the decoded value or a String describing the error.This is not a "runtime failure". This is the compiler forcing you to explicitly spell out what you want to happen the case of a decoding problem. The difference between Typescript and Elm is that Typescript's compiler will happily let your program crash when this type of issue occurs, whereas Elm's compiler won't. |
|
So, no, what I said is not "completely false"