View source

abstract thx.Validation<E, A>(Either<E, A>) from Either<E, A>

Available on all platforms

A right-biased disjunctive type with applicative functor requiring a semigroup on the left type. This is useful for composing validation functions.

Class Fields

inline function failure<E, A>(e:E):Validation<E, A>

inline function failureNel<E, A>(e:E):VNel<E, A>

inline function nn<E, A>(a:Null<A>, e:E):Validation<E, A>

inline function nnNel<E, A>(a:Null<A>, e:E):VNel<E, A>

inline function pure<E, A>(a:A):Validation<E, A>

inline function success<E, A>(a:A):Validation<E, A>

inline function successNel<E, A>(a:A):VNel<E, A>

inline function val2<X, A, B, C>(f:A -> B -> C, v1:Validation<X, A>, v2:Validation<X, B>, s:Semigroup<X>):Validation<X, C>

inline function val3<X, A, B, C, D>(f:A -> B -> C -> D, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, s:Semigroup<X>):Validation<X, D>

inline function val4<X, A, B, C, D, E>(f:A -> B -> C -> D -> E, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, v4:Validation<X, D>, s:Semigroup<X>):Validation<X, E>

inline function val5<X, A, B, C, D, E, F>(f:A -> B -> C -> D -> E -> F, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, v4:Validation<X, D>, v5:Validation<X, E>, s:Semigroup<X>):Validation<X, F>

inline function val6<X, A, B, C, D, E, F, G>(f:A -> B -> C -> D -> E -> F -> G, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, v4:Validation<X, D>, v5:Validation<X, E>, v6:Validation<X, F>, s:Semigroup<X>):Validation<X, G>

inline function val7<X, A, B, C, D, E, F, G, H>(f:A -> B -> C -> D -> E -> F -> G -> H, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, v4:Validation<X, D>, v5:Validation<X, E>, v6:Validation<X, F>, v7:Validation<X, G>, s:Semigroup<X>):Validation<X, H>

inline function val8<X, A, B, C, D, E, F, G, H, I>(f:A -> B -> C -> D -> E -> F -> G -> H -> I, v1:Validation<X, A>, v2:Validation<X, B>, v3:Validation<X, C>, v4:Validation<X, D>, v5:Validation<X, E>, v6:Validation<X, F>, v7:Validation<X, G>, v8:Validation<X, H>, s:Semigroup<X>):Validation<X, I>

inline function validation<E, A>(e:Either<E, A>):Validation<E, A>

inline function vnel<E, A>(e:Either<Nel<E>, A>):VNel<E, A>

Instance Fields

var either(get,null):Either<E, A>

function ap<B>(v:Validation<E, A -> B>, s:Semigroup<E>):Validation<E, B>

inline function flatMapV<B>(f:A -> Validation<E, B>):Validation<E, B>

inline function get_either():Either<E, A>

inline function leftMap<E0>(f:E -> E0):Validation<E0, A>

inline function map<B>(f:A -> B):Validation<E, B>

inline function wrapNel():VNel<E, A>

inline function zip<B>(v:Validation<E, B>, s:Semigroup<E>):Validation<E, Tuple2<A, B>>