Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Describe prefix/infix functions and record field accessors in Chapter 3 #285
Describe prefix/infix functions and record field accessors in Chapter 3 #285
Changes from 2 commits
7326fab
580ba98
55c276b
c8e2105
0c5a2fe
fbec125
f50148e
6f498f2
cee541b
e17346a
abc0718
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Let's pick a binary function (would also be good to link to that page) to compare and contrast infix vs prefix. For example
insertEntry
.Then we can provide examples like this:
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.
Another option for series of examples is:
Described in #261 (comment)
Edit, I see you included some of this material further on.
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 something like:
from the the sequence of examples proposed earlier might be better here.
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.
Readers might be asking: "Isn't this both equivalently compact, and easier to type?"
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 see what you mean. Maybe focusing on the inline function use case would help?
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.
Oops, I forgot edit that snippet that I copied.
Not sure if your follow-up comment still applies.
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.
Less so, now that you've clarified that you meant that
add 2
would work as well.What do you think? Are there some better examples of use cases? Or just delete this bit and just go on to operator sections?
(By the way, thanks for the detailed review!)
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.
The use cases are pretty obscure, since you can always substitute the original function name. I guess if you wanted to use
composeKleisliFlipped
in a map, backwards fish(<=<)
is nicer. Not a great example for Ch3 though.If an explanation isn't necessary for understanding the exercise code, then it's probably safe to skip. Unfortunately, if a beginner encounters something like
(+)
elsewhere, they might have a tough time finding the corresponding reference, or even making sense of the terse explanation. To address the former, I'd like to make a syntax lookup table.We also don't have a well-defined policy on the book's strategy and scope. There are opportunities to reduce duplication, but I also think it's useful to elaborate on concepts from the spec with concrete examples that involve the chapter code (for example with your explanation of property accessors).
And I appreciate all your help with improving the book as well.