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.
- Companion:
- object
Value members
Abstract methods
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.
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.
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.
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.
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.
Concrete methods
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.