-
-
Notifications
You must be signed in to change notification settings - Fork 440
Description
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.