Effect CommunityEC
Effect Communityβ€’2y agoβ€’
14 replies
RJ

Extracting Union Variants from Schema

Given a schema like this:

const Pet = Schema.literal("Dog", "Cat")


What's the best way to get a value like this:

["Dog", "Cat"]


That is, an array (or actually maybe a tuple would be even better?) containing each of the variants of the union?
Was this page helpful?