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 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 map2[B, C](ob: Option[B])(f: (A, B) => C): Option[C]
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
def toEMon(errs: StrArr): EMon[A]
def toEMon: EMon[A]
def toEMon1(fp: TextSpan, detail: String): EMon[A]

Convert to EMon with a single error if None

Convert to EMon with a single error if None

Attributes