Created
January 16, 2020 05:35
-
-
Save justinhj/82635f24b738f773591d201a619062fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// When the left and right hand side are set we take the right side | |
(LastOption("Nero".some) |+| LastOption("Titus".some)).show | |
// res1: String = "Titus" | |
// When the left is None and the right hand side is set we also take the right side | |
(LastOption(None: Option[String]) |+| LastOption("Titus".some)).show | |
// res2: String = "Titus" | |
// When the left side is set and the right side is None we keep the left side | |
(LastOption("Nero".some) |+| LastOption(None: Option[String])).show | |
// res3: String = "Nero" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment