ocaml.org
ocaml.org copied to clipboard
Update second half of seq.md, structural changes
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.