Scala: Type Families, Sealed Traits, and Exhaustive Pattern Matching
By: Matt Barackman
What is a Type Family?
A collection of objects or case classes that share a sealed trait.
In the example below, the type family would be a collection of traffic light colors with
Green as member objects.