class Person, class PersonWithId(id: PersonId, person: Person)
type PersonWithId = (PersonId, Person)
case class Person[ID](id: ID, name: String)
@tpolecat: Yes, and one with no id could be
Person[Unit].
@tpolecat: If you don't mind having that database cruft in your model. I generally like to externalize it.
@tpolecat: The way I like to do this is (a) database ids are not part of the model, and (b) every foreign key introduces a type parameter. This gives you a cruft-free model that can be made cruftful generically for code that does care about database stuff.
https://gitter.im/scala/scala?at=5a98326a888332ee3ae8f7eb
Pure Functional Database Programming with Fixpoint Types—Rob Norris
Scala Italy 2018 - Miles Sabin - Adding kind-polymorphism to the Scala programming language
Add a type parameter! One 'simple' design change, a panoply of outcomes
This programmer modeled his code after wooden nesting dolls. What happens next will amaze you.