Last active
April 21, 2021 21:26
-
-
Save deanwampler/7d5579103bcf23032f3aeb10bf4c8332 to your computer and use it in GitHub Desktop.
Scala 2 vs 3 braceless syntax: partial functions
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
val o2: Option[Int] => Int = { | |
case Some(i) => i | |
case None => 0 | |
} | |
val o3: Option[Int] => Int = | |
case Some(i) => i | |
case None => 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment