Skip to content

Detect native collections that bypass Effect Hash and Equal #35

Description

@OperationalFallacy

Effect domain values can define identity through Hash and Equal. A native Map or Set ignores those semantics and falls back to JavaScript key identity; converting domain keys to ad-hoc strings conceals the same decision.

Nomoss planner example:

new Map(Arr.map(current, (node) => [keyString(node.key), node]))

The collection choice is a semantic decision, not a stylistic one. A diagnostic should flag native Map/Set use in Effect-oriented code and require the author to consider HashMap/HashSet or a deliberate, documented scalar key. It must not prescribe a mechanical replacement: plain JavaScript collections remain valid where their identity semantics are intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions