Preparing search index...
The search index is not available
Houston Common Library
Houston Common Library
@45drives/houston-common-ui
Validation
Interface Validation<E, T>
Basic Monad Interface
interface
Validation
<
E
,
T
>
{
@@type
:
string
;
acc
(
)
:
Validation
<
E
,
IValidationAcc
>
;
ap
<
V
>
(
eitherFn
:
Validation
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
Validation
<
E
,
V
>
;
apTo
<
V
>
(
value
:
Validation
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
Validation
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
;
bimap
<
F
,
V
>
(
fnF
:
(
(
fail
:
E
)
=>
F
)
,
fnS
:
(
(
val
:
T
)
=>
V
)
)
:
Validation
<
F
,
V
>
;
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
;
cata
<
Z
>
(
failFn
:
(
(
fail
:
E
)
=>
Z
)
,
successFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
;
catchMap
<
F
>
(
fn
:
(
(
fail
:
E
)
=>
Validation
<
F
,
T
>
)
)
:
Validation
<
F
,
T
>
;
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
;
equals
(
other
:
Validation
<
E
,
T
>
)
:
boolean
;
fail
(
)
:
E
;
failMap
<
F
>
(
fn
:
(
(
fail
:
E
)
=>
F
)
)
:
Validation
<
F
,
T
>
;
fantasy-land/ap
?
<
V
>
(
afn
:
Applicative
<
(
(
val
:
T
)
=>
V
)
>
)
:
Applicative
<
V
>
;
fantasy-land/chain
?
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Chain
<
V
>
)
)
:
Chain
<
V
>
;
fantasy-land/equals
?
(
other
:
Validation
<
E
,
T
>
)
:
boolean
;
fantasy-land/map
?
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Functor
<
V
>
;
flatMap
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
;
fold
<
Z
>
(
failFn
:
(
(
fail
:
E
)
=>
Z
)
,
successFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
;
foldLeft
<
V
>
(
initial
:
V
)
:
(
(
fn
:
(
(
acc
:
V
,
val
:
T
)
=>
V
)
)
=>
V
)
;
foldRight
<
V
>
(
initial
:
V
)
:
(
(
fn
:
(
(
val
:
T
,
acc
:
V
)
=>
V
)
)
=>
V
)
;
forEach
(
fn
:
(
(
val
:
T
)
=>
void
)
)
:
void
;
forEachFail
(
fn
:
(
(
val
:
E
)
=>
void
)
)
:
void
;
isFail
(
)
:
boolean
;
isSuccess
(
)
:
boolean
;
join
<
V
>
(
)
:
Validation
<
E
,
V
>
;
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Validation
<
E
,
V
>
;
success
(
)
:
T
;
swap
(
)
:
Validation
<
T
,
E
>
;
takeLeft
(
m
:
Validation
<
E
,
T
>
)
:
Validation
<
E
,
T
>
;
takeRight
(
m
:
Validation
<
E
,
T
>
)
:
Validation
<
E
,
T
>
;
toEither
(
)
:
Either
<
E
,
T
>
;
toMaybe
(
)
:
Maybe
<
T
>
;
}
Type Parameters
E
T
Hierarchy-Diagram
Legend
interface
public method
Hierarchy (
view full
)
IMonad
<
T
>
Setoid
<
Validation
<
E
,
T
>
>
ITraversable
<
T
>
Catamorphism
<
E
,
T
>
Validation
Index
Properties
@@type
Methods
acc
ap
ap
To
bimap
bind
cata
catch
Map
chain
equals
fail
fail
Map
fantasy-
land/ap?
fantasy-
land/chain?
fantasy-
land/equals?
fantasy-
land/map?
flat
Map
fold
fold
Left
fold
Right
for
Each
for
Each
Fail
is
Fail
is
Success
join
map
success
swap
take
Left
take
Right
to
Either
to
Maybe
Properties
@@type
@@type
:
string
Methods
acc
acc
(
)
:
Validation
<
E
,
IValidationAcc
>
Returns
Validation
<
E
,
IValidationAcc
>
ap
ap
<
V
>
(
eitherFn
:
Validation
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
Validation
<
E
,
V
>
Type Parameters
V
Parameters
eitherFn
:
Validation
<
E
,
(
(
val
:
T
)
=>
V
)
>
Returns
Validation
<
E
,
V
>
ap
To
ap
To
<
V
>
(
value
:
Validation
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
Validation
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
Type Parameters
V
Parameters
value
:
Validation
<
E
,
V
>
Returns
T
extends
(
(
arg
:
V
)
=>
any
)
?
Validation
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
bimap
bimap
<
F
,
V
>
(
fnF
:
(
(
fail
:
E
)
=>
F
)
,
fnS
:
(
(
val
:
T
)
=>
V
)
)
:
Validation
<
F
,
V
>
Type Parameters
F
V
Parameters
fnF
:
(
(
fail
:
E
)
=>
F
)
(
fail
:
E
)
:
F
Parameters
fail
:
E
Returns
F
fnS
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
Validation
<
F
,
V
>
bind
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
(
val
:
T
)
:
Validation
<
E
,
V
>
Parameters
val
:
T
Returns
Validation
<
E
,
V
>
Returns
Validation
<
E
,
V
>
cata
cata
<
Z
>
(
failFn
:
(
(
fail
:
E
)
=>
Z
)
,
successFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
Type Parameters
Z
Parameters
failFn
:
(
(
fail
:
E
)
=>
Z
)
(
fail
:
E
)
:
Z
Parameters
fail
:
E
Returns
Z
successFn
:
(
(
val
:
T
)
=>
Z
)
(
val
:
T
)
:
Z
Parameters
val
:
T
Returns
Z
Returns
Z
catch
Map
catch
Map
<
F
>
(
fn
:
(
(
fail
:
E
)
=>
Validation
<
F
,
T
>
)
)
:
Validation
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
fail
:
E
)
=>
Validation
<
F
,
T
>
)
(
fail
:
E
)
:
Validation
<
F
,
T
>
Parameters
fail
:
E
Returns
Validation
<
F
,
T
>
Returns
Validation
<
F
,
T
>
chain
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
(
val
:
T
)
:
Validation
<
E
,
V
>
Parameters
val
:
T
Returns
Validation
<
E
,
V
>
Returns
Validation
<
E
,
V
>
equals
equals
(
other
:
Validation
<
E
,
T
>
)
:
boolean
Parameters
other
:
Validation
<
E
,
T
>
Returns
boolean
fail
fail
(
)
:
E
Returns
E
fail
Map
fail
Map
<
F
>
(
fn
:
(
(
fail
:
E
)
=>
F
)
)
:
Validation
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
fail
:
E
)
=>
F
)
(
fail
:
E
)
:
F
Parameters
fail
:
E
Returns
F
Returns
Validation
<
F
,
T
>
Optional
fantasy-
land/ap
fantasy-
land/ap
<
V
>
(
afn
:
Applicative
<
(
(
val
:
T
)
=>
V
)
>
)
:
Applicative
<
V
>
Type Parameters
V
Parameters
afn
:
Applicative
<
(
(
val
:
T
)
=>
V
)
>
Returns
Applicative
<
V
>
Optional
fantasy-
land/chain
fantasy-
land/chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Chain
<
V
>
)
)
:
Chain
<
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Chain
<
V
>
)
(
val
:
T
)
:
Chain
<
V
>
Parameters
val
:
T
Returns
Chain
<
V
>
Returns
Chain
<
V
>
Optional
fantasy-
land/equals
fantasy-
land/equals
(
other
:
Validation
<
E
,
T
>
)
:
boolean
Parameters
other
:
Validation
<
E
,
T
>
Returns
boolean
Optional
fantasy-
land/map
fantasy-
land/map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Functor
<
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
Functor
<
V
>
flat
Map
flat
Map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
)
:
Validation
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Validation
<
E
,
V
>
)
(
val
:
T
)
:
Validation
<
E
,
V
>
Parameters
val
:
T
Returns
Validation
<
E
,
V
>
Returns
Validation
<
E
,
V
>
fold
fold
<
Z
>
(
failFn
:
(
(
fail
:
E
)
=>
Z
)
,
successFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
Type Parameters
Z
Parameters
failFn
:
(
(
fail
:
E
)
=>
Z
)
(
fail
:
E
)
:
Z
Parameters
fail
:
E
Returns
Z
successFn
:
(
(
val
:
T
)
=>
Z
)
(
val
:
T
)
:
Z
Parameters
val
:
T
Returns
Z
Returns
Z
fold
Left
fold
Left
<
V
>
(
initial
:
V
)
:
(
(
fn
:
(
(
acc
:
V
,
val
:
T
)
=>
V
)
)
=>
V
)
Type Parameters
V
Parameters
initial
:
V
Returns
(
(
fn
:
(
(
acc
:
V
,
val
:
T
)
=>
V
)
)
=>
V
)
(
fn
:
(
(
acc
:
V
,
val
:
T
)
=>
V
)
)
:
V
Parameters
fn
:
(
(
acc
:
V
,
val
:
T
)
=>
V
)
(
acc
:
V
,
val
:
T
)
:
V
Parameters
acc
:
V
val
:
T
Returns
V
Returns
V
fold
Right
fold
Right
<
V
>
(
initial
:
V
)
:
(
(
fn
:
(
(
val
:
T
,
acc
:
V
)
=>
V
)
)
=>
V
)
Type Parameters
V
Parameters
initial
:
V
Returns
(
(
fn
:
(
(
val
:
T
,
acc
:
V
)
=>
V
)
)
=>
V
)
(
fn
:
(
(
val
:
T
,
acc
:
V
)
=>
V
)
)
:
V
Parameters
fn
:
(
(
val
:
T
,
acc
:
V
)
=>
V
)
(
val
:
T
,
acc
:
V
)
:
V
Parameters
val
:
T
acc
:
V
Returns
V
Returns
V
for
Each
for
Each
(
fn
:
(
(
val
:
T
)
=>
void
)
)
:
void
Parameters
fn
:
(
(
val
:
T
)
=>
void
)
(
val
:
T
)
:
void
Parameters
val
:
T
Returns
void
Returns
void
for
Each
Fail
for
Each
Fail
(
fn
:
(
(
val
:
E
)
=>
void
)
)
:
void
Parameters
fn
:
(
(
val
:
E
)
=>
void
)
(
val
:
E
)
:
void
Parameters
val
:
E
Returns
void
Returns
void
is
Fail
is
Fail
(
)
:
boolean
Returns
boolean
is
Success
is
Success
(
)
:
boolean
Returns
boolean
join
join
<
V
>
(
)
:
Validation
<
E
,
V
>
Type Parameters
V
Returns
Validation
<
E
,
V
>
map
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Validation
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
Validation
<
E
,
V
>
success
success
(
)
:
T
Returns
T
swap
swap
(
)
:
Validation
<
T
,
E
>
Returns
Validation
<
T
,
E
>
take
Left
take
Left
(
m
:
Validation
<
E
,
T
>
)
:
Validation
<
E
,
T
>
Parameters
m
:
Validation
<
E
,
T
>
Returns
Validation
<
E
,
T
>
take
Right
take
Right
(
m
:
Validation
<
E
,
T
>
)
:
Validation
<
E
,
T
>
Parameters
m
:
Validation
<
E
,
T
>
Returns
Validation
<
E
,
T
>
to
Either
to
Either
(
)
:
Either
<
E
,
T
>
Returns
Either
<
E
,
T
>
to
Maybe
to
Maybe
(
)
:
Maybe
<
T
>
Returns
Maybe
<
T
>
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
On This Page
@@type
acc
ap
ap
To
bimap
bind
cata
catch
Map
chain
equals
fail
fail
Map
fantasy-
land/ap
fantasy-
land/chain
fantasy-
land/equals
fantasy-
land/map
flat
Map
fold
fold
Left
fold
Right
for
Each
for
Each
Fail
is
Fail
is
Success
join
map
success
swap
take
Left
take
Right
to
Either
to
Maybe
Official Cockpit API Documentation
Houston Common Library
Loading...
Basic Monad Interface