Skip to content

Improve argument naming in Stream module for better readability #5746

@danielo515

Description

@danielo515

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: contcontinue

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: sstate

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions