Effect CommunityEC
Effect Community2y ago
3 replies
Fabian

Creating Mutually Recursive Schemas with a Single Interface

If I have a mutually recursive schema, I need to create a separate interface that the schema then refers to like: const schema: Schema<MyStruct>. If any member in the schema that has different From and To types like e.g. age: S.NumberFromString, then I need to provide another arg: Schema<MyStruct, MyStructFrom> that contains that type change. Is there a better way to do mutually recursive schemas so that I don't have to provide two interfaces?
Was this page helpful?