Improve argument naming in Stream module for better readability
Summary
I'd like to suggest improving the argument naming in the Stream module to enhance code readability and make the API more intuitive for developers.
Proposed Changes
1. Predicate function arguments: cont → continue
Currently, predicate functions use abbreviated names like cont. I suggest using the full word continue for clarity.
Example: Stream.runFoldWhileEffect and similar functions
2. State arguments: s → state
State parameters are currently abbreviated as s. Using the full word state would make the code more self-documenting.
Rationale
- Improved readability: Full words are easier to understand at a glance, especially for developers new to the library
- Self-documenting code: Descriptive parameter names reduce the need to reference documentation
- Consistency: Aligns with Effect's generally clear and expressive API design
Affected Functions
While runFoldWhileEffect is one example, there are several other functions in the Stream module that would benefit from this improvement.
Impact
This is not a breaking change, as the arguments are currently positional. If they were object keys this will be a major breaking change, but given they are just positionals the only impact will be in function signatures suggestions and that stuff.
Thank you for considering this suggestion! The Effect library is fantastic, and these small improvements could make it even more accessible to developers.
continue is a reserved word in JavaScript, hence the shortened name. The other ones would be fine.
PRs are welcomed for such changes - the maintainers likely will have higher-priority items to address as this does not address functional issues.
Ah, true, I always forgot about certain reserved words.
Well, I think it can then be name continueWhile or something like that.
Will open a PR with this suggestions