Skip to content

Instantly share code, notes, and snippets.

@supermanue
Created April 11, 2022 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save supermanue/5a483104f3d3de8af029748fbc03627c to your computer and use it in GitHub Desktop.
Save supermanue/5a483104f3d3de8af029748fbc03627c to your computer and use it in GitHub Desktop.
Motivation for Tagged Types
case class Person(name: String, surname: String)
def getPerson(name: String, surname: String): Person = ???
val person = Person("manuel", "rodriguez")
getPerson(person.surname, person.name)
//doesn't find anything because name and surname are in wrong order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment