ResultCompanion

kantan.codecs.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.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

trait Simple[F] extends 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.

Attributes

Supertypes
trait Simple[F]
class Object
trait Matchable
class Any
Known subtypes
trait WithDefault[F]
class WithError[F]
object OpenResult
object ProcessResult
object StringResult
Show all
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.

Attributes

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

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

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

Attributes

Supertypes
trait WithDefault[F]
trait Simple[F]
trait Simple[F]
class Object
trait Matchable
class Any
Show all
Known subtypes
object OpenResult
object ProcessResult
object StringResult

Value members

Concrete methods

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.

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

Attributes