Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sealed class Option<out T> {
- object None : Option<Nothing>()
- data class Some<out T>(val value: T) : Option<T>()
- }
- sealed class Either<out A, out B> {
- data class Left<out A>(val value: A) : Either<A, Nothing>()
- data class Right<out B>(val value: B) : Either<Nothing, B>()
- }
- sealed class List<out A> {
- object Nil : List<Nothing>()
- data class Cons<out A>(val head: A, val tail: List<A>) : List<A>()
- }
Add Comment
Please, Sign In to add comment