OptionExtensions

ostrat.OptionExtensions
class OptionExtensions[A](thisOption: Option[A])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def defaultFold[B](fSome: A => B)(implicit ev: DefaultValue[B]): B

An alternative fold extension method for Option where it searches for an implicit instance of DefaultValue[B] and uses the default value in the case of None'

An alternative fold extension method for Option where it searches for an implicit instance of DefaultValue[B] and uses the default value in the case of None'

Attributes

def flatMapErrBi[E <: Throwable, B](f: A => ErrBi[E, B]): ErrBi[E | ExcNFT, B]
def fld[B](noneValue: => B, fSome: A => B): B

An alternative fold extension method for Option with a single parameter list.

An alternative fold extension method for Option with a single parameter list.

Attributes

def getSafe(implicit ev: DefaultValue[A]): A

safe get. Seeks an implicit value for the GefaultValue type class for the type of the option. Returns the value if a some else returns the default value.

safe get. Seeks an implicit value for the GefaultValue type class for the type of the option. Returns the value if a some else returns the default value.

Attributes

def replaceNone(newOption: => Option[A]): Option[A] | OptionExtensions[A]

Keeps the same value if Some, lazily takes the parameter value if None.

Keeps the same value if Some, lazily takes the parameter value if None.

Attributes

def toArr[AA <: Arr[A]](implicit build: BuilderArrMap[A, AA]): AA