Skip to content

Improve the documentation of let operators#2206

Merged
lpw25 merged 1 commit intoocaml:trunkfrom
lpw25:improve-let-syntax-manual
Jan 2, 2019
Merged

Improve the documentation of let operators#2206
lpw25 merged 1 commit intoocaml:trunkfrom
lpw25:improve-let-syntax-manual

Conversation

@lpw25
Copy link
Copy Markdown
Contributor

@lpw25 lpw25 commented Dec 18, 2018

Based on some feedback in #1947 and #2170, I've tried to improve the documentation for binding operators. Further suggestions very much welcome.


This extension provides a convenient syntax for working with monads and
applicatives. Users can define {\em let operators}:
Users can define {\em let operators}:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be binding as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That bit is just describing the let operators, there is a bit lower down that describes the and operators. I'm using "binding operators" to refer to both of those at once.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes perfect sense. Apologies for missing the local context!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to keep the short description of the extension rationale at the beginning.

Starting with Users can define {\em let operators} may lost some users, even if they are somehow familiar with the notion of monads and applicatives.

I am wondering if it may also helps to make the link with the standard let clearer by introducing the identity monad as a toy example before the option monad.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that the identity monad is more likely to confuse people than help them, as it is the opposite of a motivating example: an example of when the new feature is useless.

Re. when to mention monads. We can't have it both ways. On one side people are concerned that mentioning monads at the beginning will scare off people who don't know what they are, on the other side you are concerned that not mentioning monads will scare off people who do know what monads are. I don't think it matters much, but I think I would lean towards something that is less likely to scare off beginners -- I trust people who know what a monad is more to work things out -- so I'd prefer to leave the first mention of monads to the rationale section.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is clearly not possible to please everyone with the documentation in this case. If you think that the current state is better (or a good enough start), I am perfectly fine with it.

I was merely worried than, for people that don't know what are monads or applicatives, the interest of custom let-binding is hard to grasp on the fly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was merely worried than, for people that don't know what are monads or applicatives, the interest of custom let-binding is hard to grasp on the fly.

It does seem worth mentioning, but on the other hand, it can always be improved in subsequent commits.

@lpw25
Copy link
Copy Markdown
Contributor Author

lpw25 commented Jan 2, 2019

If no one objects I'm going to merge this later today. If people want to fine tune the documentation more then we can do that in another PR.

@lpw25 lpw25 merged commit 3dac696 into ocaml:trunk Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants