Uncategorized

Reflections on Companion Type Systems

FavoriteLoadingAdd to favorites

TLDR: When manipulating a sealed trait and its subclasses, it can be useful to define a dual type hierarchy on their companion objects. We can use reflection to test this “Companion Type System” and safely gather all of its members. That was short, now keep this post so that you can read it later! In a previous post, we described…
Original post: Reflections on Companion Type Systems
Source: Kifi