FSharpPlus


Validation<'error, 't> Type

A 'Validation' is either a value of the type 'error or 't, similar to 'Result'. However, the 'Applicative' instance for 'Validation' accumulates errors using a 'Semigroup' on 'error. In contrast, the Applicative for 'Result' returns only the first error. A consequence of this is that 'Validation' is not a monad. There is no F#+ 'Bind' method since that would violate monad rules.

Table of contents

Functor

Static members

Static member Description

f <!> x

Full Usage: f <!> x

Parameters:
Returns: Validation<'Error, 'U>

Lifts a function into a Validator. Same as map. To be used in Applicative Style expressions, combined with <*>

f : 'T -> 'U
x : Validation<'Error, 'T>
Returns: Validation<'Error, 'U>

Applicative

Static members

Static member Description

x *> y

Full Usage: x *> y

Parameters:
Returns: Validation<^Error, 'U>
Modifiers: inline
Type parameters: 'U

Sequences two Validations left-to-right, discarding the value of the first argument.

x : Validation<^Error, 'T>
y : Validation<^Error, 'U>
Returns: Validation<^Error, 'U>

x <* y

Full Usage: x <* y

Parameters:
Returns: Validation<^Error, 'U>
Modifiers: inline
Type parameters: 'T

Sequences two Validations left-to-right, discarding the value of the second argument.

x : Validation<^Error, 'U>
y : Validation<^Error, 'T>
Returns: Validation<^Error, 'U>

Other module members

Union cases

Union case Description

Failure 'error

Full Usage: Failure 'error

Parameters:
    Item : 'error

Item : 'error

Success 't

Full Usage: Success 't

Parameters:
    Item : 't

Item : 't

Static members

Static member Description

f <*> x

Full Usage: f <*> x

Parameters:
Returns: Validation<^Error, 'U>
Modifiers: inline
Type parameters: 'U
f : Validation<^Error, ('T -> 'U)>
x : Validation<^Error, 'T>
Returns: Validation<^Error, 'U>

x <|> y

Full Usage: x <|> y

Parameters:
Returns: Validation<^Error, 'T>
Modifiers: inline
x : Validation<^Error, 'T>
y : Validation<^Error, 'T>
Returns: Validation<^Error, 'T>

Validation.Bifold(t, f, g, z)

Full Usage: Validation.Bifold(t, f, g, z)

Parameters:
    t : Validation<'err, 'a>
    f : 'b -> 'err -> 'b
    g : 'b -> 'a -> 'b
    z : 'b

Returns: 'b
Modifiers: inline
Type parameters: 'b
t : Validation<'err, 'a>
f : 'b -> 'err -> 'b
g : 'b -> 'a -> 'b
z : 'b
Returns: 'b

Validation.BifoldBack(t, f, g, z)

Full Usage: Validation.BifoldBack(t, f, g, z)

Parameters:
    t : Validation<'err, 'a>
    f : 'err -> 'b -> 'b
    g : 'a -> 'b -> 'b
    z : 'b

Returns: 'b
Modifiers: inline
Type parameters: 'b
t : Validation<'err, 'a>
f : 'err -> 'b -> 'b
g : 'a -> 'b -> 'b
z : 'b
Returns: 'b

Validation.BifoldMap(t, f, g)

Full Usage: Validation.BifoldMap(t, f, g)

Parameters:
    t : Validation<'err, 'a>
    f : 'err -> 'b
    g : 'a -> 'b

Returns: 'b
Modifiers: inline
Type parameters: 'b
t : Validation<'err, 'a>
f : 'err -> 'b
g : 'a -> 'b
Returns: 'b

Validation.Bimap(x, f, g)

Full Usage: Validation.Bimap(x, f, g)

Parameters:
    x : Validation<'T, 'V>
    f : 'T -> 'U
    g : 'V -> 'W

Returns: Validation<'U, 'W>
x : Validation<'T, 'V>
f : 'T -> 'U
g : 'V -> 'W
Returns: Validation<'U, 'W>

Validation.Bisequence(t)

Full Usage: Validation.Bisequence(t)

Parameters:
Returns: ^b
Modifiers: inline
t : Validation<^err, ^a>
Returns: ^b

Validation.Bitraverse(t, f, g)

Full Usage: Validation.Bitraverse(t, f, g)

Parameters:
    t : Validation<'err, 'a>
    f : 'err -> ^b
    g : 'a -> ^d

Returns: ^c
Modifiers: inline
t : Validation<'err, 'a>
f : 'err -> ^b
g : 'a -> ^d
Returns: ^c

Validation.Lift2(f, x, y)

Full Usage: Validation.Lift2(f, x, y)

Parameters:
Returns: Validation<^Error, 'V>
Modifiers: inline
Type parameters: 'V, ^Error
f : 'T -> 'U -> 'V
x : Validation<^Error, 'T>
y : Validation<^Error, 'U>
Returns: Validation<^Error, 'V>

Validation.Lift3(f, x, y, z)

Full Usage: Validation.Lift3(f, x, y, z)

Parameters:
Returns: Validation<^Error, 'W>
Modifiers: inline
Type parameters: 'V, 'W, ^Error
f : 'T -> 'U -> 'V -> 'W
x : Validation<^Error, 'T>
y : Validation<^Error, 'U>
z : Validation<^Error, 'V>
Returns: Validation<^Error, 'W>

Validation.Map(x, f)

Full Usage: Validation.Map(x, f)

Parameters:
Returns: Validation<'Error, 'U>
x : Validation<'Error, 'T>
f : 'T -> 'U
Returns: Validation<'Error, 'U>

Validation.Return(x)

Full Usage: Validation.Return(x)

Parameters:
    x : 'a

Returns: Validation<'b, 'a>
x : 'a
Returns: Validation<'b, 'a>

Validation.Sequence(t)

Full Usage: Validation.Sequence(t)

Parameters:
Returns: ^Functor>
Modifiers: inline
t : Validation<'Error, ^Functor<'T>>
Returns: ^Functor>

Validation.SequenceBiApply(t)

Full Usage: Validation.SequenceBiApply(t)

Parameters:
Returns: Validation<'Error[], 'T[]>

Creates an array with either all Success values or the Failure ones.

t : Validation<'Error, 'T>[]
Returns: Validation<'Error[], 'T[]>

Validation.SequenceBiApply(t)

Full Usage: Validation.SequenceBiApply(t)

Parameters:
Returns: Validation<'Error list, 'T list>

Creates a list with either all Success values or the Failure ones.

t : Validation<'Error, 'T> list
Returns: Validation<'Error list, 'T list>

Validation.Traverse(t, f)

Full Usage: Validation.Traverse(t, f)

Parameters:
    t : Validation<'Error, 'T>
    f : 'T -> ^Functor<'U>

Returns: ^Functor>
Modifiers: inline
t : Validation<'Error, 'T>
f : 'T -> ^Functor<'U>
Returns: ^Functor>

Validation.get_Empty ()

Full Usage: Validation.get_Empty ()

Returns: Validation<^a, 'b>
Modifiers: inline
Returns: Validation<^a, 'b>