-
Notifications
You must be signed in to change notification settings - Fork 92
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
Clarify how to use types for more than validation #62
base: master
Are you sure you want to change the base?
Conversation
There's some stuff about using inference to consume JSON in the inference section, but I like the direction of this too and the mention of needing documentation less. I think we should drop the I'll come back to this after reviewing the other 5 PR's in case there's overlap. |
Second thought: Perhaps we can put much of your content in the Inference section. Now that I re-visit it, it looks much more appropriate for this section which is "types are helpers too!" as opposed to "types stop bad things". And get rid of the JSON examples in there which, while a good demo, are probably a bit too complicated whereas your tuple + holes example is much cleaner. |
How does my example illustrate type inference?
I agree, I also plan to submit a pull request for that section :) |
Okay, I'll rework my pull request around that example instead. |
This bit: Uses inference doesn't it? |
Hmm, that's true, that part would make more sense in the inference section. The part about using types as a lightweight documentation still belongs to this section, right? |
Works for me. Whatever you're baking locally sounds good. I think you're already keeping this in mind but just in case: try to keep all the sections roughly the same size, short and snappy. We'll later be able to add "Learn more" links that take you to a full page, but that content is not yet created. |
I'm indeed trying to keep things short, but the length did increase a bit. Stop me if I go too far! |
The "Statically typed" paragraph mentions that type are "not only a form of guarantee", but the examples did not reflect that.
Here's a version with |
The "Statically typed" feature snippet ends with:
But the text before that only talks about rejecting bad programs at compile time, and the examples after that too.
I think it's a good idea to mention the fact that we use types for more than just catching errors, but we should at least give a hint of what we're talking about, or give a link to a more complete explanation. Here is my attempt at a very short explanation of what types are used for in Haskell.
In order to avoid using too much space, I've also removed the unicode example, which didn't add anything to what had already been said. If it was there to point out that yes, Haskell does support unicode, then the example should be moved to a more appropriate section than "Statically typed".