Collected sources and patterns will appear here. Add from search or the patterns library.
PolymorphicJson -> Either<T, U>
Represent polymorphic JSON fields accepting multiple types as a generic Either container to maintain type safety during serialization.
Problem it solves
Statically-typed target languages struggle to model TypeScript-style union types without losing type safety or falling back to dynamically typed objects.
Consumes
Emits
The real projects this mechanism was found in. Attribution is the point — this is how the best teams actually do it.