Created
May 15, 2017 10:04
-
-
Save dimsuz/8651220f4161192efd8341dda3ea8dd2 to your computer and use it in GitHub Desktop.
Optional in Kotlin
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
sealed class Optional<out T> { | |
data class Just<out T>(val element: T): Optional<T>() | |
object None: Optional<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment