Closed kriskowal closed 1 month ago
Looks good so far. Do this symmetrically for CopyArrays, Taggeds, CopyMaps, and passable primitives. I think that covers all the cases, but you should double check whether I forgot anything.
Rewrote all sections to speak in terms of the copy data that each pattern matches instead of using TypeScript. Covered CopyRecord, CopyArray, and CopyMaps. Tags aren’t heterogeneous collections. CopySet and CopyBag are collections but can’t be fixed-length and heterogeneous with types for corresponding keys or indexes, so they’re out.
Until we have a rigorous treatment on the usage of patterns, this adds a bandaid to the code itself so anyone looking for how to make a pattern for a struct-like CopyRecord, tuple-like CopyArray, or fixed-length heterogeneous CopyMap will find their way.