Skip to content

Update second half of seq.md, structural changes #3026

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jakubsvec001
Copy link
Contributor

Some of these updates are to convert code blocks into Utop format.

The remaining update is for the second half of this document. This second half included several suggestions for improvement that required structural changes.

This pull request may be difficult to read using diff comparison for this reason.

The updated headings read:

...
## Consumers vs Producers
### Sequence Consumers: Partially Applied Functions as Parameters
### Sequence Producers: Partially Applied Functions as Results
## Beware of Seq.Cons vs Seq.cons
### Understanding the Difference
## Sequences for Conversions
## Miscellaneous Considerations

- In "Understanding the Difference", I make the generalization that Seq.Cons is particularly useful for generating recursive producers, while Seq.cons is particularly useful for prepending a cons cell to a sequence. I hope this is accurate, happy to be told otherwise if it is overly generic

- After reading some of the suggestions, I kept the `fibs` examples over using a suggested simpler example for `ints`, but I left comments where the simpler `ints` version could be placed. These would require minor updates to the surrounding text, which I can make if you prefer the simpler example

- I expanded a bit on the section describing "producers" and "consumers"

As always, I'm happy to make updates or leave it the way it currently is.

Copy link
Collaborator

@cuihtlauac cuihtlauac left a comment

Choose a reason for hiding this comment

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

Thanks, @jakubsvec001, you're making this better. A couple of changes.

Copy link
Collaborator

@cuihtlauac cuihtlauac left a comment

Choose a reason for hiding this comment

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

Small changes

Comment on lines +375 to 377
# #show Seq.node;;
type 'a node = 'a Seq.node = Nil | Cons of 'a * 'a Seq.t

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# #show Seq.node;;
type 'a node = 'a Seq.node = Nil | Cons of 'a * 'a Seq.t
# #show Seq.node;;
type 'a node = 'a Seq.node = Nil | Cons of 'a * 'a Seq.t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cuihtlauac I am unable to commit this suggestion: the tooltip says "This suggestion is invalid because no changes were made to the code".

I tried marking this conversation as resolved, but it did not change the status of the request for change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants