-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The website doesn't explain how to import a package #334
Comments
+1 I struggled with this quite a bit when starting off. Only issue I'm thinking is that if you have something like
Is there a risk that beginners will just copy the whole thing into their module when they only need import eg |
I think the risk is high that beginners will copy the whole thing indeed, and because a lot of code examples assume Also, with regard to the examples above, the 4th line of Idem for If this did not help, why adding them again in the In my opinion, they are better illustrated by code examples that include the But to explain them at first, I think it would be better to fix the "Using Packages" link and explain how to install and import in this documentation (including
|
Yes, sometime package authors add example that also include the imports, but it is not always the case, so I think an example generated automatically could be a safer approach. Having begineers copying all the imports, even if not necessary, seems to me a minor issue compared to have them struggling in making their code to work. At least the code is running. They will eventually learn and most IDE now have warnings for unused imports. About explaing about importing modules, this could be a good target: https://elm-lang.org/docs/syntax#modules |
I have seen beginners struggling in understanding how to import a package, especially because there is no enforced consistency in naming.
For example
Such information now is available in the right side column but it is not explicit:
This extra info could be added in the already present "About" page (https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/about):
The text was updated successfully, but these errors were encountered: