Last active
October 9, 2018 21:18
-
-
Save stasimus/26a75b2ab20db9c1bfcb24ac65e73ce8 to your computer and use it in GitHub Desktop.
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
assertNull(p1?.flatMap { f -> p2.flatMap { s -> f + s } }) | |
//or | |
val firstNullable = "param1".unit()?.flatMap { f -> null?.flatMap { f.plus(it) } }assertNull(firstNullable) | |
//or | |
val bothAreDefined = "param1".unit()?.flatMap { f -> "param2".unit()?.flatMap { f.plus(it) } } | |
assertEquals("param1param2", bothAreDefined) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment