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 updecodeValue docu not up to date #629
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
halfzebra
May 31, 2016
Contributor
Would it make sense to stop using module namespace in it's own documentation and use namespaces only for the external modules, used in the code snippets?
I find the import statement above slightly confusing.
What I would offer is to assume, that we're using the current module with:
import Json.Decode exposing (..) -- for dcoumented
import Dict -- for externalHow does that sound?
|
Would it make sense to stop using module namespace in it's own documentation and use namespaces only for the external modules, used in the code snippets? I find the import statement above slightly confusing. What I would offer is to assume, that we're using the current module with: import Json.Decode exposing (..) -- for dcoumented
import Dict -- for externalHow does that sound? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
May 31, 2016
Contributor
That would be a general policy issue for @evancz to decide. I agree that it would be good for the whole documentation of the core package to be consistent in some such way. I rely heavily on it in teaching, so am always willing to invest into improving it. If a decision were made about "this is how it's to be done throughout the documentation of this package", someone (you, me, someone) could go through all modules and enact that policy everywhere.
About your concrete proposal, I think it should be at least like "import Dict exposing (Dict)", i.e., so that types that are the "main type" of a module, having the same name, need not be given in qualified form.
|
That would be a general policy issue for @evancz to decide. I agree that it would be good for the whole documentation of the core package to be consistent in some such way. I rely heavily on it in teaching, so am always willing to invest into improving it. If a decision were made about "this is how it's to be done throughout the documentation of this package", someone (you, me, someone) could go through all modules and enact that policy everywhere. About your concrete proposal, I think it should be at least like "import Dict exposing (Dict)", i.e., so that types that are the "main type" of a module, having the same name, need not be given in qualified form. |
jvoigtlaender commentedMay 28, 2016
One issue is that the code example in its documentation (http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Json-Decode#decodeValue) is still given in terms of
Signals.Another thing is that the documentation mentions
Json.Valueinstead ofJson.Encode.ValueorJson.Decode.Value. That is confusing, becauseJson.Valuedoes not exist as a type incore. One solution to this (other than renaming the three occurrences ofJson.Value) could be to add the lineto the code example.