EMon

ostrat.EMon
See theEMon companion object
sealed trait EMon[+A]

An Errors handling class. Consider changing name to EHan. The main ways to consume the final result of the flatMap operation are fold, getElse, foreach and forEither. This corresponds, but is not functionally equivalent to an Either[StrList, A] or Either[List[String], +A]. There are advantages to having a separate class and I find that I rarely use Either apart from with standard errors as the Left type. However use the methods biMap, to Either, eitherMap and eitherFlatMap when interoperability with Either is required. In my view Either[T] class is redundant and is rarely used except as an errors handler. So it makes sense to use a dedicated class.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Bad[A]
class Good[A]

Members list

Concise view

Value members

Abstract methods

def biMap[L2, R2](fLeft: StringArr => L2, fRight: A => R2): Either[L2, R2]

These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

Attributes

def flatMap[B](f: A => EMon[B]): EMon[B]
def flatMap2ToOption[A2, B](o2: EMon[A2], f: (A, A2) => B): Option[B]

These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

Attributes

def fld[B](noneValue: => B, fGood: A => B): B
def fold[B](noneValue: => B)(fGood: A => B): B
def foldDo(fGood: A => Unit)(fBad: StringArr => 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 Good 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 Good classes to avoid boxing.

Attributes

def foldErrs[B](fGood: A => B)(fBad: StringArr => B): B

Fold the EMon of type A into a type of B.

Fold the EMon of type A into a type of B.

Attributes

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

Will perform action if Good. Does nothing if Bad.

Will perform action if Good. Does nothing if Bad.

Attributes

def get: A

Gets the value of Good, throws exception on Bad.

Gets the value of Good, throws exception on Bad.

Attributes

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

def goodOrOther[A1 >: A](otherEMon: => EMon[A1]): EMon[A1]
def map[B](f: A => B): EMon[B]

Maps the Good case of this EMon with the function.

Maps the Good case of this EMon with the function.

Attributes

def map2[A2, R](e2: EMon[A2])(f: (A, A2) => R): EMon[R]

2 type parameters, maps the Good case of this EMon, with the Good case of an additional EMon of a different type.

2 type parameters, maps the Good case of this EMon, with the Good case of an additional EMon of a different type.

Attributes

def map3[A2, A3, R](e2: EMon[A2], e3: EMon[A3])(f: (A, A2, A3) => R): EMon[R]

3 type parameters, maps the Good case of this EMon, with the Good cases of an additional 3 EMons of a different types.

3 type parameters, maps the Good case of this EMon, with the Good cases of an additional 3 EMons of a different types.

Attributes

def map4[A2, A3, A4, R](e2: EMon[A2], e3: EMon[A3], e4: EMon[A4])(f: (A, A2, A3, A4) => R): EMon[R]

4 type parameters, maps the Good case of this EMon, with the Good cases of an additional 3 EMons of a different types.

4 type parameters, maps the Good case of this EMon, with the Good cases of an additional 3 EMons of a different types.

Attributes

def map5[A2, A3, A4, A5, R](e2: EMon[A2], e3: EMon[A3], e4: EMon[A4], e5: EMon[A5])(f: (A, A2, A3, A4, A5) => R): EMon[R]

5 type parameters, maps the Good case of this EMon, with the Good cases of an additional 4 EMons of a different types.

5 type parameters, maps the Good case of this EMon, with the Good cases of an additional 4 EMons of a different types.

Attributes

def map6[A2, A3, A4, A5, A6, R](e2: EMon[A2], e3: EMon[A3], e4: EMon[A4], e5: EMon[A5], e6: EMon[A6])(f: (A, A2, A3, A4, A5, A6) => R): EMon[R]

6 type parameters, maps the Good case of this EMon, with the Good cases of an additional 5 EMons of a different types.

6 type parameters, maps the Good case of this EMon, with the Good cases of an additional 5 EMons of a different types.

Attributes

def mapToEither[D](f: A => D): Either[StringArr, D]

Maps Good to Right[Strings, D] and Bad to Left[Strings, D]. These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

Maps Good to Right[Strings, D] and Bad to Left[Strings, D]. These are implemented in the base traits GoodBase[+A] and BadBase[+A] as Either[+A, +B] boxes all value classes.

Attributes

def mapToOption[B](f: A => B): Option[B]
def toEMon2[B1, B2](f: A => EMon2[B1, B2]): EMon2[B1, B2]

Concrete methods

def findSetting[A](settingStr: String)(implicit ev: Unshow[A]): EMon[A]
Implicitly added by EMonStringImplicit
def findSettingElse[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by EMonStringImplicit
def findSomeSetting[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by EMonStringImplicit
def findSomeSettingElse[A : Unshow](settingStr: String, elseValue: => A): A
Implicitly added by EMonStringImplicit
def findType[A](implicit ev: Unshow[A]): EMon[A]
Implicitly added by EMonStringImplicit
def findTypeElse[A : Unshow](elseValue: => A): A
Implicitly added by EMonStringImplicit
def findTypeForeach[A : Unshow](f: A => Unit): Unit
Implicitly added by EMonStringImplicit
def seqMapUniqueGood[B](f: A => EMon[B]): EMon[B]
Implicitly added by EMonSeqGen

Method on EMon[SeqGen[A]]. If this is good, the sequence is mapped with a function from A to EMon[B]. If that mapping produces on Good value, the unique Good value is returned.

Method on EMon[SeqGen[A]]. If this is good, the sequence is mapped with a function from A to EMon[B]. If that mapping produces on Good value, the unique Good value is returned.

Attributes