Effect CommunityEC
Effect Community16mo ago
17 replies
Federico Biccheddu

Combinator for `Schema.TaggedClass` Default Constructor Transformation

Is there any combinator similar to Schema.compose for Schema.TaggedClasses calling default constructors on every struct's field?

The use case is transforming an application command to a domain command delegating validation and parsing to Schema.

I can add a static readonly fromEncode: (_: typeof this.Encoded) => new this({ /** snip */ }) on the domain command but doesn't feel right.
Was this page helpful?