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 upDocumentation for JSON.Decode.Value is misleading #957
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
toraritte
May 14, 2018
Value is originally defined in Json.Encode and it is only aliased in Json.Decode. On the other hand, Json.Encode.Value's documentation is more general by saying that it "represents a JavaScript value".
https://github.com/elm-lang/json/blob/master/src/Json/Encode.elm#L35
https://github.com/elm-lang/json/blob/master/src/Json/Decode.elm#L405
toraritte
commented
May 14, 2018
•
|
https://github.com/elm-lang/json/blob/master/src/Json/Encode.elm#L35 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
arowM
May 14, 2018
Thanks. So, how about using the same documentation as Json.Encode.Value to avoid confusion.
arowM
commented
May 14, 2018
|
Thanks. So, how about using the same documentation as |
referenced
this issue
in toraritte/json
May 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Making the PR about it the canonical one for this |
arowM commentedMay 8, 2018
•
edited
Edited 2 times
-
arowM
edited May 8, 2018 (most recent)
-
arowM
edited May 8, 2018
In
masterbranch, documentation aboutJSON.Decode.Valueis as follows.But I guess it is misleading because
Valueis now not only for JSON objects.(Though it is defined in
JSON.Decodemodule...)For example, it is also used for
Html.Events.onto handleEventobject, which is not exactly the JSON object.In another instace, we use
Valueas an input/output type of ports to handle some JS objects that Elm cannot handle such asFileobject.(In fact, I have not realized that
Valuecan be used to passFileobject to ports at first.)P.S.
I'm not sure that this is the right place to report about
JSON.Decodemodule because it seems to be moving to independent package, so if this is not the right place, I'll apologize.