unsplash / sum-types-io-ts

io-ts bindings for @unsplash/sum-types.
https://unsplash.github.io/sum-types-io-ts/
MIT License
2 stars 1 forks source link

Support internally tagged non-nullary sums #18

Closed samhh closed 1 year ago

samhh commented 1 year ago

Borrowing terminology from Serde: https://serde.rs/enum-representations.html#internally-tagged

For any given tag and any arbitrary sibling data:

Sum.Member<'Sun'> | Sum.Member<'Rain', { value: number }>

<->

{ tag: 'Sun' } | { tag: 'Rain', value: number }