Packages

o

kantan.codecs

ResultCompanion

object ResultCompanion

Provides trait that result companion object can extend.

The idea is that libraries that rely on kantan.codecs are likely to provide type-constrained versions of result, such as DecodeResult in kantan.csv. Users are likely to expect goodies such as fromTry or sequence on DecodeResult's companion object, which can be achieved by extending kantan.codecs.ResultCompanion.WithDefault.

Source
ResultCompanion.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResultCompanion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait Simple[F] extends VersionSpecificResultCompanion.Simple[F]

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

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

    If your specialised result type has a sane default (such as TypeError for DecodeResult in kantan.csv), use WithDefault instead.

  2. trait WithDefault[F] extends Simple[F]

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

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

    This default error type is materialised by fromThrowable.

  3. abstract class WithError[F] extends WithDefault[F]

    Similar to WithDefault, but uses IsError to deal with error cases.

Value Members

  1. def nonFatal[E, S](f: (Throwable) => E)(s: => S): Either[E, S]

    Evaluates the specified expression, catching non-fatal errors and sticking them in a Left.