Good

ostrat.Good
See theGood companion object
final case class Good[+A](value: A) extends EMon[A]

The Good sub class of EMon[+A]. This corresponds, but is not functionally equivalent to an Either[List[String], +A] based Right[Refs[String], +A].

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait EMon[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def badMap(f: (Bad[A]) => Bad[A]): EMon[A]

Maps over the Bad errors side of this bifunctor.

Maps over the Bad errors side of this bifunctor.

Attributes

Definition Classes
override def biMap[L2, R2](fLeft: StrArr => 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

Definition Classes
override def errs: StrArr

Attributes

Definition Classes
override def flatMap[B](f: A => EMon[B]): EMon[B]

Attributes

Definition Classes
override def flatMap2ToOption[A2, B](e2: EMon[A2], f: (A, A2) => B): Option[B]

Attributes

Definition Classes
override def flatMapToEither[D](f: A => Either[StrArr, D]): Either[StrArr, D]

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

Definition Classes
override def fld[B](noneValue: => B, fGood: A => B): B

Attributes

Definition Classes
override def fold[B](noneValue: => B)(fGood: A => B): B

Attributes

Definition Classes
override def foldErrs[B](fGood: A => B)(fBad: StrArr => 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

Definition Classes
override 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

Definition Classes
override def forGoodForBad(fGood: A => Unit)(fBad: StrArr => 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

Definition Classes
override def get: A

Gets the value of Good, throws exception on Bad.

Gets the value of Good, throws exception on Bad.

Attributes

Definition Classes
override 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

Definition Classes
override def goodOrOther[A1 >: A](otherEMon: => EMon[A1]): Good[A]

Returns this EMon[A] if this is Good, else returns the operand EMon[A].

Returns this EMon[A] if this is Good, else returns the operand EMon[A].

Attributes

Definition Classes
override def isBad: Boolean

Attributes

Definition Classes
override def isGood: Boolean

Attributes

Definition Classes
override 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

Definition Classes
override 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

Definition Classes
override 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

Definition Classes
override 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

Definition Classes
override 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

Definition Classes
override 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

Definition Classes
override def mapToEither[D](f: A => D): Either[StrArr, 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

Definition Classes
override def mapToOption[B](f: A => B): Option[B]

Attributes

Definition Classes
override def toEMon2[B1, B2](f: A => EMon2[B1, B2]): EMon2[B1, B2]

Attributes

Definition Classes
override def toEither: Either[StrArr, A]

Attributes

Definition Classes
override def toOption: Option[A]

Attributes

Definition Classes

Inherited methods

def noneMap(newErrs: => StrArr): EMon[A]

Creates new errors for an ENone.

Creates new errors for an ENone.

Attributes

Inherited from:
EMon
def noneMap1(newErr: => String): EMon[A]

Creates a new error for an ENone.

Creates a new error for an ENone.

Attributes

Inherited from:
EMon

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product