ErrBi

ostrat.ErrBi
See theErrBi companion object
sealed trait ErrBi[+E <: Throwable, +A]

Biased bifunctor for errors.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fail[E]
object FailNotFound
object FailWrongType
class Succ[A]
Show all

Members list

Value members

Abstract methods

def flatMap[EE >: E <: Throwable, B](f: A => ErrBi[EE, B]): ErrBi[EE, B]

Classic flatMap function as we see on a Scala Option.

Classic flatMap function as we see on a Scala Option.

Attributes

def flatMapAcc[EE >: E <: Throwable, B](f: A => ErrBiAcc[EE, B])(implicit ctE: ClassTag[EE], ctB: ClassTag[B]): ErrBiAcc[EE, B]
def fld[B](fFail: E => B, fSucc: A => B): B

Alternative fold, that only takes one parameter list. this ErrBi into a type B. Takes two function parameters, one converts from A to B as in a normal map method. The second parameter in its own parameter list converts from the Error type to type B.

Alternative fold, that only takes one parameter list. this ErrBi into a type B. Takes two function parameters, one converts from A to B as in a normal map method. The second parameter in its own parameter list converts from the Error type to type B.

Attributes

def fold[B](fFail: E => B)(fSucc: A => B): B

Fold this ErrBi into a type B. Takes two function parameters, one converts from A to B as in a normal map method. The second parameter in its own parameter list converts from the Error type to type B.

Fold this ErrBi into a type B. Takes two function parameters, one converts from A to B as in a normal map method. The second parameter in its own parameter list converts from the Error type to type B.

Attributes

def forFld(fErr: E => Unit, fSucc: A => Unit): Unit

This is just a Unit returning fold, but is preferred because the method is explicit that it is called for effects, rather than to return a value. This method is implemented in the leaf Succ and Fail classes to avoid boxing.

This is just a Unit returning fold, but is preferred because the method is explicit that it is called for effects, rather than to return a value. This method is implemented in the leaf Succ and Fail classes to avoid boxing.

Attributes

def forFold(fErr: E => Unit)(fSucc: A => Unit): Unit

This is just a Unit returning fold, but is preferred because the method is explicit that it is called for effects, rather than to return a value. This method is implemented in the leaf Succ and Fail classes to avoid boxing.

This is just a Unit returning fold, but is preferred because the method is explicit that it is called for effects, rather than to return a value. This method is implemented in the leaf Succ and Fail classes to avoid boxing.

Attributes

def forSucc(f: A => Unit): Unit

Will perform action if success. Does nothing if Fail.

Will perform action if success. Does nothing if Fail.

Attributes

def map[B](f: A => B): ErrBi[E, B]

Classic map function as we see on a Scala Option or List.

Classic map function as we see on a Scala Option or List.

Attributes

def succOrOther[EE >: E <: Throwable, AA >: A](otherErrBi: => ErrBi[EE, AA]): ErrBi[EE, AA]

Returns this if success, else returns the other ErrBi.

Returns this if success, else returns the other ErrBi.

Attributes

Concrete methods

def findSetting[A](settingStr: String)(implicit ev: Unshow[A]): ErrBi[Throwable, A]
Implicitly added by ErrBiStringImplicit
def findSettingElse[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by ErrBiStringImplicit
def findSomeSetting[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by ErrBiStringImplicit
def findSomeSettingElse[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by ErrBiStringImplicit
def findType[A](implicit ev: Unshow[A]): ErrBi[Throwable, A]
Implicitly added by ErrBiStringImplicit

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON.

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON.

Attributes

def findTypeElse[A](elseValue: => A)(implicit ev: Unshow[A]): A
Implicitly added by ErrBiStringImplicit

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON or return the elseValue if that fails.

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON or return the elseValue if that fails.

Attributes

def findTypeForeach[A : Unshow](f: A => Unit): Unit
Implicitly added by ErrBiStringImplicit

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON and then perform a foreach on the value if successful.

Extension method to map this ErrBi String to find a value of the given type from the String parsed as RSON and then perform a foreach on the value if successful.

Attributes

def flatOptMap[B](f: A => Option[B]): ErrBi[E | ExcNFT, B]

Classic flatMap function taking a function from A => Option[B] rather than the standard ErrBi of B.

Classic flatMap function taking a function from A => Option[B] rather than the standard ErrBi of B.

Attributes

def get: A
final def getElse(elseValue: A): A

Gets the value of Good or returns the elseValue parameter if Bad. Both Good and Bad should be implemented in the leaf classes to avoid unnecessary boxing of primitive values.

Gets the value of Good or returns the elseValue parameter if Bad. Both Good and Bad should be implemented in the leaf classes to avoid unnecessary boxing of primitive values.

Attributes