Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upNote (in docu) that Json.Decode.succeed may fail? #613
Comments
jvoigtlaender
referenced this issue
May 19, 2016
Closed
Json.Decode.decodeString never succeeds when input is empty string #585
jvoigtlaender
changed the title from
Note that Json.Decode.succeed may fail
to
Note (in docu) that Json.Decode.succeed may fail?
Aug 21, 2016
jvoigtlaender
added
the
docs
label
Aug 30, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Is addressed in the new documentation. |
jvoigtlaender
closed this
Oct 12, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jvoigtlaender commentedMay 19, 2016
•
edited
Edited 1 time
-
jvoigtlaender
edited May 28, 2016 (most recent)
The current documentation says (http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Json-Decode#succeed):
But actually, this should be preconditioned on the input being valid JSON. Already something simple as an empty string as input can make the decoder fail. That's non-obvious and has led to confusion, see here and here (and also in the more distant past).
Maybe warn about this in some way in the documentation, since the current wording "always succeeds" does raise wrong expectations?