By: Matt Barackman
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 Red
, Yellow
, and Green
as member objects.
By: Matt Barackman
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 Red
, Yellow
, and Green
as member objects.
scala> import shapeless._, record._ | |
import shapeless._ | |
import record._ | |
scala> case class Person(name: String, address: String, age: Int) | |
defined class Person | |
scala> val joe = Person("Joe", "Brighton", 33) | |
joe: Person = Person(Joe,Brighton,33) |