Package-level declarations

Types

Link copied to clipboard
sealed class Try<A> : K1<Try.T, A>

A computation that either succeeded with a value (Success) or failed with an exception (Failure).

Link copied to clipboard

Applicative instance for Try; fails fast on the first Try.Failure.

Link copied to clipboard

Applicative lifting helpers for Try.

Link copied to clipboard
interface TryEq<A> : Eq<Try<A>>

Eq instance for Try: successes are compared with eqA and failures with eqError.

Link copied to clipboard
interface TryFoldable : Foldable<Try.T>

Foldable instance for Try; a Try.Failure folds as empty.

Link copied to clipboard
interface TryFunctor : Functor<Try.T>

Functor instance for Try; exceptions thrown by the mapped function become Try.Failure.

Link copied to clipboard
interface TryHash<A> : Hash<Try<A>> , TryEq<A>

Hash instance for Try, consistent with TryEq.

Link copied to clipboard

Monad instance for Try.

Link copied to clipboard

MonadError instance for Try with Throwable as the error type.

Link copied to clipboard

Monadic lifting helpers for Try.

Link copied to clipboard
interface TryShow<A> : Show<Try<A>>

Show instance for Try, rendered as Success(a) or Failure(error).

Link copied to clipboard

Traversable instance for Try.

Functions

Link copied to clipboard
fun <A> Try.Companion.eq(eqA: Eq<A>, eqError: Eq<Throwable> = Eq.fromEquals()): Eq<Try<A>>

Returns the Eq instance for Try; errors are compared with equals unless eqError is given.

Link copied to clipboard
fun <A> Try.Companion.hash(hashA: Hash<A>, hashError: Hash<Throwable> = Hash.fromHashCode()): Hash<Try<A>>

Returns the Hash instance for Try; errors use equals / hashCode unless hashError is given.

Link copied to clipboard
fun <A> Try.Companion.show(showA: Show<A>, showError: Show<Throwable> = Show.fromToString()): Show<Try<A>>

Returns the Show instance for Try; errors are rendered with toString unless showError is given.