-
Notifications
You must be signed in to change notification settings - Fork 301
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
Small fixes for let
and do
in Syntax.md
#69
Conversation
…-syntax Small fixes for `let` and `do` in Syntax.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is looking great so far!
language/Syntax.md
Outdated
@@ -402,7 +402,7 @@ conditional = if 2 > 1 then "ok" else "oops" | |||
|
|||
## Let and where bindings | |||
|
|||
The `let` keyword a collection of local declarations, which may be mutually recursive, and which may include type declarations: | |||
The `let` keyword defines a collection of local declarations, which may be mutually recursive, and which may include type declarations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer "introduces" rather than "defines" here; what does everyone else think?
I would only change it if defines is wrong. Thanks for fixing this, BTW! |
I think "defines" is wrong — the keyword can't really define anything by itself, it's just a keyword. I guess I was really asking if anyone can think of any better alternatives to my suggestion. |
I agree that "defines" is not correct. |
@andreasthoelke Thanks very much! This looks good to merge now as far as I can tell, was there anything else you think wants doing or should I go ahead and merge? |
When reading the descriptions of We could go:
|
language/Syntax.md
Outdated
@@ -402,7 +402,7 @@ conditional = if 2 > 1 then "ok" else "oops" | |||
|
|||
## Let and where bindings | |||
|
|||
The `let` keyword a collection of local declarations, which may be mutually recursive, and which may include type declarations: | |||
`let` expressions encompass a list of local declarations, which may be mutually recursive, and which may include type declarations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the previous version with "The let
keyword introduces a collection of local declarations...", actually.
language/Syntax.md
Outdated
@@ -415,13 +415,13 @@ factorial = | |||
go 1 | |||
``` | |||
|
|||
The `where` keyword can also be used to introduce local declarations at the end of a value declaration: | |||
`where` clauses can be added at the end of a function declaration, and allow to bind variables that are visible throughout the function: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sentence was okay before; what was your reasoning behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, it's incorrect to say "function declarations", you can also do e.g.
pi :: Number
pi = 4.0 * (sum (take 100 (taylorSeries arctan 1.0))
where
taylorSeries = [...]
arctan = [...]
It would be incorrect to call this a "function declaration" because it isn't declaring a function; you can use a where clause in any kind of value declaration which is why "value declaration" is preferable. Also, "... allow to bind variables ..." is grammatically incorrect. Most importantly though, I think it would be best to make the structure of this sentence resemble that of the earlier sentence that tells you what the let
keyword does as much as we reasonably can, so that it's as clear as possible that let
and where
do basically the same thing.
I'm not really sure what this latest iteration adds over what we had previously, ideally I think we would just add "introduces" to the |
Great, thanks very much :) |
Ok, I changed this back. |
Small fixes in the let and do documentation.