Created
April 11, 2022 17:14
-
-
Save supermanue/5a483104f3d3de8af029748fbc03627c to your computer and use it in GitHub Desktop.
Motivation for Tagged Types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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