Comments (6)
We have discussed this on the list before, and it is unclear that adding type signatures are definitely "the right thing to do" for these examples. Do you mind opening this up for discussion on the forum to get other opinions?
from elm-lang.org.
There is nothing to discuss. A type-signature is part of the documentation of a function. If this is not the attitude of the elm community, then it's obviously not worth learning and I will just stick to Haskell.
from elm-lang.org.
I don't think it is so simple. Type signatures are important, especially in real projects, but I want these examples to be accessible to people who have no familiarity with types. For many people, the examples will be the first interaction with the language and I don't want to throw too many concepts at them at once.
Also, my opinion is not the "Elm community" opinion which is why I think it'd be good to talk about this on the list. I may be wrong that leaving off the types is making the examples more accessible.
from elm-lang.org.
Well then think of it this way. I was trying to learn elm. I couldn't figure out the types. So as new user, I am asking for the type signatures to be added. Hope that makes it clear.
from elm-lang.org.
What to do with the examples' code style should be discussed over at the ML (keeping with the Elm community's tradition of not acting without a thorough discussion).
For example, I too think types are the very best form of documentation, but I like that the examples showcase type inference as well.
For the time being, note that elm-lang's editor will tell you the type, along with a link to the API documentation, if you put the cursor over a name from Elm's built-in library (i.e. sampleOn
, toForm
, collage
, etc).
And if you want to see the type of every name (i.e. the example-specific record types, etc), you could just clone the examples repo to your machine and run elm --print-types
on the source of the example in question.
On a related note, showing the output of --print-types
is something that's currently being added to share-elm. Maybe elm-lang could do the same.
from elm-lang.org.
Types are used a ton more in the examples. I tried to follow "best practice" style in pretty much all of them. Let's open PR's for specific examples if it can be improved.
from elm-lang.org.
Related Issues (20)
- ASCII codes are seven bit HOT 1
- google search preview of the site is a little bit scary for new visitors
- delete account on discourse? HOT 2
- Add permalink feature in Try Elm
- Elm executable package is considered to be 'Dangerous' by Windows Smart Screen
- SEO meta description tag HOT 1
- Hover causing layout changes HOT 3
- links to examples on the A Farewell to FRP page are broken
- The landing page is quite user hostile HOT 6
- New playground design feedback
- Inaccuracy: Elm does not enforce semantic versioning
- Main page logo effects competely broken in Firefox HOT 10
- Cat-gifs not showing gifs of cats
- Blank website when JavaScript disabled
- font color issues on elm-lang.org/docs/syntax with chrome based browsers on MacOS
- Out-of-the-box experience.
- None of the default Elm examples show how to use CSS or give any CSS-related advice
- Type question on form.html HOT 1
- Explain `import` early on guide.elm-lang.org
- Add "How to uninstall elm" section HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-lang.org.