-
Notifications
You must be signed in to change notification settings - Fork 25
Streams #266
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
Streams #266
Conversation
ppolesiuk
left a comment
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 implementation looks solid. I have some minor comments regarding names of some functions, and documentation comments. A also would consider making type parameter X named for all functions through parameter mechanism.
|
Changes:
Please, verify formatting style that I have used. Type annotation required me to break lines and I am not sure if this tyle is right. |
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.
As you have asked, I wrote some comments about formatting. And there is still one unresolved conversation from my previous 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.
Pull Request Overview
This PR introduces a new Stream module for lazy lists (also known as streams) to the standard library. This is part of the larger Pretty-printer PR #256 and provides the minimal required utilities for the pretty-printer implementation.
Key changes:
- Adds
lib/Stream.framwith lazy stream implementation including constructors, transformations, and folds - Adds comprehensive test coverage in
test/stdlib/stdlib0007_Stream.fram - Extends
lib/Lazy.framwithpureReffunction and improvedpureLazydocumentation for better integration with streams
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| lib/Stream.fram | Implements lazy stream data structure with core operations (construction, mapping, filtering, folding) and proper laziness semantics |
| test/stdlib/stdlib0007_Stream.fram | Provides test coverage for stream operations including conversions, transformations, and edge cases |
| lib/Lazy.fram | Adds pure reference constructor and improves documentation for pureLazy to support stream implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ppolesiuk
left a comment
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.
Now, looks better. I have some minor comments, and Copilot have found some spelling errors in the documentation comments.
|
For consistency, I changed the pattern matching order. Nil / empty list is always the first case in pattern matching |
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Initializes lazy stream by iteratively applying function `f` on previous results. | ||
|
|
||
| This function may generate infinite stream. |
Copilot
AI
Nov 19, 2025
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 documentation states 'iteratively applying function f on previous results' but the implementation uses unfold which applies f to the seed/state, not to previous results. Consider clarifying as 'by repeatedly applying function f to a state value' or 'by unfolding a state with function f'.
| Initializes lazy stream by iteratively applying function `f` on previous results. | |
| This function may generate infinite stream. | |
| Initializes a lazy stream by repeatedly applying function `f` to a state value. | |
| This function may generate an infinite stream. |
ppolesiuk
left a comment
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 PR is ready for merge. Thanks! The last comments from Copilot can be ignored, especially that on left to right direction of foldRight. It's a complete nonsense.
This PR is a part of Pretty-printer PR #256 . This module have been separated for easier review. Interface is not complete and might be expanded in future. This version provides minimal required set of utilities to run pretty-printer.