Skip to content

feat: v2#2

Open
peterboyer wants to merge 22 commits into
mainfrom
micro
Open

feat: v2#2
peterboyer wants to merge 22 commits into
mainfrom
micro

Conversation

@peterboyer

@peterboyer peterboyer commented Nov 17, 2025

Copy link
Copy Markdown
Owner
  • redesigns ADT<> as primary way to define ADT variant types
    • requires that you use a union of ADT<...> | ADT<...> | ...
    • allows that many variants with the same data type can be defined without code duplication
  • redesigns ADT<T>() as primary way to construct variant values
    • build ADT types first, then pass as T type parameter.
    • returns shared memory-efficient proxy to create values
    • constructors are shared based on type
  • removes all ADT namespace utilities
    • Keys can be derived from X['$type'].
    • Pick can be derived from Extract<X, ADT<"PickThis">>.
      • Equivalent to Extract<X, { $type: "PickThis" }>.
    • Omit can be derived from Exclude<X, ADT<"OmitThis">>.
      • Equivalent to Exclude<X, { $type: "OmitThis" }>.
  • removes custom discriminant support
    • much easier to cast an external ADT than introduce broad interface complexity to support custom discriminants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant