Skip to content

Rename replaceIf or setAt #65

Closed
Closed
@pzp1997

Description

@pzp1997

replaceIf and setAt are really two variants of the same kind of operation. They both replace some element(s) with a given value. Perhaps their naming should reflect this similarity. (Similar to how we have updateIf and updateAt.) Some questions to consider.

  1. Are there any advantages provided by keeping the current naming?
  2. If not, which name describes the operation better? (It may or may not be relevant to the discussion to note that Array uses the name set for a similar operation.)
  3. Perhaps out of the scope of this issue but also related, do we even need setAt and replaceIf when they are essentially equivalent to calling updateAt and updateIf with an update function of always x.

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