Effect CommunityEC
Effect Community2y ago
71 replies
singingbanana

Handling Data and Schema with Nested Enums

Hey! Im getting started and i am curious when you choose between Data and Schema and how to interop betwen both. To give a specific example imagine a nested enum which i thought as representing as a Data.TaggedEnum.

TransactionType:
  - depositary:
    - cash
    - savings
  - loan:
    - auto
    - personal

For serializaton it makes sense to me to do something like a tuple such as [depositary, cash] or [loan, auto] but at runtime i would like to have a nicer representation.
Was this page helpful?