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.
Effect domain values can define identity through
HashandEqual. A nativeMaporSetignores those semantics and falls back to JavaScript key identity; converting domain keys to ad-hoc strings conceals the same decision.Nomoss planner example:
The collection choice is a semantic decision, not a stylistic one. A diagnostic should flag native
Map/Setuse in Effect-oriented code and require the author to considerHashMap/HashSetor a deliberate, documented scalar key. It must not prescribe a mechanical replacement: plain JavaScript collections remain valid where their identity semantics are intentional.