Scala Option Best Practices

Scala option best practices

Scala best practices I wish someone'd told me about - Nicolas Rinaudo

sealed abstract classOption[+A] extends IterableOnce[A] with Product with Serializable

Abstract Value Members

  1. abstract defcanEqual(that: Any): Boolean
  2. abstract defget: A
  3. abstract defproductArity: Int
  4. abstract defproductElement(n: Int): Any

Concrete Value Members

  1. final def!=(arg0: Any): Boolean
  2. final def##(): Int
  3. def+(other: String): String
  4. final def++[B >: A](suffix: collection.IterableOnce[B]): collection.Iterable[B]
  5. def->[B](y: B): (Option[A], B)
  6. final def==(arg0: Any): Boolean
  7. final defaddString(b: collection.mutable.StringBuilder): collection.mutable.StringBuilder
  8. final defaddString(b: collection.mutable.StringBuilder, sep: String): collection.mutable.StringBuilder
  9. defaddString(b: collection.mutable.StringBuilder, start: String, sep: String, end: String): collection.mutable.StringBuilder
  10. final defasInstanceOf[T0]: T0
  11. defclone(): AnyRef
  12. final defcollect[B](pf: PartialFunction[A, B]): Option[B]
  13. defcollectFirst[B](pf: PartialFunction[A, B]): Option[B]
  14. defconcat[B >: A](suffix: collection.IterableOnce[B]): collection.Iterable[B]
  15. final defcontains[A1 >: A](elem: A1): Boolean
  16. defcopyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int
  17. defcopyToArray[B >: A](xs: Array[B], start: Int): Int
  18. defcopyToArray[B >: A](xs: Array[B]): Int
  19. defcorresponds[B](that: collection.IterableOnce[B])(p: (A, B) => Boolean): Boolean
  20. defdrop(n: Int): collection.Iterable[A]
  21. defdropRight(n: Int): collection.Iterable[A]
  22. defdropWhile(p: (A) => Boolean): collection.Iterable[A]
  23. defempty: collection.Iterable[A]
  24. defensuring(cond: (Option[A]) => Boolean, msg: => Any): Option[A]
  25. defensuring(cond: (Option[A]) => Boolean): Option[A]
  26. defensuring(cond: Boolean, msg: => Any): Option[A]
  27. defensuring(cond: Boolean): Option[A]
  28. final defeq(arg0: AnyRef): Boolean
  29. defequals(arg0: AnyRef): Boolean
  30. final defexists(p: (A) => Boolean): Boolean
  31. final deffilter(p: (A) => Boolean): Option[A]
  32. final deffilterNot(p: (A) => Boolean): Option[A]
  33. deffinalize(): Unit
  34. final defflatMap[B](f: (A) => Option[B]): Option[B]
  35. defflatten[B](implicit ev: <:<[A, Option[B]]): Option[B]
  36. final deffold[B