EOr

e.scala.EOr
See theEOr companion trait
object EOr

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
EOr.type

Members list

Type members

Classlikes

final case class Failure(e: E) extends EOr[Nothing]

A failed EOr

A failed EOr

Value parameters

e

An error

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait EOr[Nothing]
class Object
trait Matchable
class Any
Show all
final case class Success[+A](a: A) extends EOr[A]

A successful EOr

A successful EOr

Type parameters

A

Type of the value this EOr can contain

Value parameters

a

A value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait EOr[A]
class Object
trait Matchable
class Any
Show all

Inherited types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply[A](e: E): EOr[A]

Constructs a failed EOr containing given E

Constructs a failed EOr containing given E

Type parameters

A

Type of value of resulting EOr

Value parameters

e

An E

Attributes

Returns

A new failed EOr containing given E

def apply[A](a: A): EOr[A]

Constructs a successful EOr containing given value

Constructs a successful EOr containing given value

Type parameters

A

Type of value of resulting EOr

Value parameters

a

A value

Attributes

Returns

A new failed EOr containing given value

def fromEither[L, R](either: Either[L, R])(ifLeft: L => E): EOr[R]

Constructs an EOr from an _root_.scala.util.Either

Constructs an EOr from an _root_.scala.util.Either

Type parameters

L

Type of Left value of Either

R

Type of Right value of Either

Value parameters

either

An Either

ifLeft

An E conversion function in case Either is Left

Attributes

Returns

An EOr containing either Right value in Either or an E computed by given function

def fromOption[A](option: Option[A])(ifNone: => E): EOr[A]

Constructs an EOr from an _root_.scala.Option

Constructs an EOr from an _root_.scala.Option

Type parameters

A

Type of value of Option

Value parameters

ifNone

An error to use in case Option is None

option

An Option

Attributes

Returns

An EOr containing either value in Option or given E

def fromTry[A](t: Try[A])(ifFailure: Throwable => E): EOr[A]

Constructs an EOr from a _root_.scala.util.Try

Constructs an EOr from a _root_.scala.util.Try

Type parameters

A

Type of value of Try

Value parameters

ifFailure

An E conversion function in case Try is Failure

t

A Try

Attributes

Returns

An EOr containing either value in Try or an E computed by given function

Concrete fields

A default E to be used when condition does not hold while filtering an EOr

A default E to be used when condition does not hold while filtering an EOr

Attributes

See also
val unit: EOr[Unit]

A successful EOr of type Unit

A successful EOr of type Unit

Attributes