Guest User

Untitled

a guest
Jan 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. sealed class Option<out T> {
  2. object None : Option<Nothing>()
  3. data class Some<out T>(val value: T) : Option<T>()
  4. }
  5.  
  6. sealed class Either<out A, out B> {
  7. data class Left<out A>(val value: A) : Either<A, Nothing>()
  8. data class Right<out B>(val value: B) : Either<Nothing, B>()
  9. }
  10.  
  11. sealed class List<out A> {
  12. object Nil : List<Nothing>()
  13. data class Cons<out A>(val head: A, val tail: List<A>) : List<A>()
  14. }
Add Comment
Please, Sign In to add comment