Companion

Functions

Link copied to clipboard
@JvmName(name = "tryCatch")
inline fun <A> catch(f: () -> A): Validated<Throwable, A>
@JvmName(name = "tryCatch")
inline fun <E, A> catch(recover: (Throwable) -> E, f: () -> A): Validated<E, A>
Link copied to clipboard
inline fun <A> catchNel(f: () -> A): ValidatedNel<Throwable, A>
Link copied to clipboard

Converts an Either<E, A> to a Validated<E, A>.

Link copied to clipboard
inline fun <E, A> fromNullable(value: A?, ifNull: () -> E): Validated<E, A>

Converts a nullable A? to a Validated<E, A>, where the provided ifNull output value is returned as Invalid when the specified value is null.

Link copied to clipboard
inline fun <E, A> fromOption(o: Option<A>, ifNone: () -> E): Validated<E, A>

Converts an Option<A> to a Validated<E, A>, where the provided ifNone output value is returned as Invalid when the specified Option is None.

Link copied to clipboard
Link copied to clipboard
inline fun <E, A, B> lift(crossinline f: (A) -> B): (Validated<E, A>) -> Validated<E, B>

inline fun <A, B, C, D> lift(crossinline fl: (A) -> C, crossinline fr: (B) -> D): (Validated<A, B>) -> Validated<C, D>

Lifts two functions to the Bifunctor type.

Link copied to clipboard