WithDefault

kantan.codecs.ResultCompanion.WithDefault
trait WithDefault[F] extends Simple[F]

Provides companion object methods for result types that have a sane default error type.

This default error type is materialised by fromThrowable.

Attributes

Graph
Supertypes
trait Simple[F]
trait Simple[F]
class Object
trait Matchable
class Any
Known subtypes
class WithError[F]
object OpenResult
object ProcessResult
object StringResult

Members list

Value members

Abstract methods

protected def fromThrowable(t: Throwable): F

Turns an exception into an error.

Turns an exception into an error.

Attributes

Concrete methods

def apply[S](s: => S): Either[F, S]

Attempts to evaluate the specified expression.

Attempts to evaluate the specified expression.

Attributes

def fromTry[S](t: Try[S]): Either[F, S]

Turns the specified Try into a result.

Turns the specified Try into a result.

Attributes

Inherited methods

def failure(f: F): Either[F, Nothing]

Turns the specified value into a failure.

Turns the specified value into a failure.

Attributes

Inherited from:
Simple
def sequence[S, M <: (IterableOnce)](rs: M[Either[F, S]])(implicit bf: BuildFrom[M[Either[F, S]], S, M[S]]): Either[F, M[S]]

Turns a collection of results into a result of a collection.

Turns a collection of results into a result of a collection.

Attributes

Inherited from:
Simple
def success[S](s: S): Either[F, S]

Turns the specified value into a success.

Turns the specified value into a success.

Attributes

Inherited from:
Simple