Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of pattern matching in scala
// Pattern matching <3
scala> val X = 'b'
X: Char = b
scala> val List(_, (X, x)) = List(('a', 1), ('b', 2))
x: Int = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment