Preparing search index...
The search index is not available
Houston Common Library
Houston Common Library
@45drives/houston-common-ui
Either
Interface Either<E, T>
Either
interface
Either
<
E
,
T
>
{
@@type
:
string
;
ap
<
V
>
(
eitherFn
:
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
Either
<
E
,
V
>
;
apTo
<
V
>
(
value
:
Either
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
;
bimap
<
Z
,
V
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
V
)
)
:
Either
<
Z
,
V
>
;
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
;
cata
<
Z
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
;
catchMap
<
F
>
(
fn
:
(
(
err
:
E
)
=>
Either
<
F
,
T
>
)
)
:
Either
<
F
,
T
>
;
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
;
equals
(
other
:
Either
<
E
,
T
>
)
:
boolean
;
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
:
Either
<
E
,
T
>
)
:
boolean
;
fantasy-land/map
?
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Functor
<
V
>
;
flatMap
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
;
fold
<
Z
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
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
;
forEachLeft
(
fn
:
(
(
val
:
E
)
=>
void
)
)
:
void
;
isLeft
(
)
:
boolean
;
isRight
(
)
:
boolean
;
join
<
V
>
(
)
:
Either
<
E
,
V
>
;
left
(
)
:
E
;
leftMap
<
F
>
(
fn
:
(
(
leftVal
:
E
)
=>
F
)
)
:
Either
<
F
,
T
>
;
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Either
<
E
,
V
>
;
right
(
)
:
T
;
swap
(
)
:
Either
<
T
,
E
>
;
takeLeft
(
m
:
Either
<
E
,
T
>
)
:
Either
<
E
,
T
>
;
takeRight
(
m
:
Either
<
E
,
T
>
)
:
Either
<
E
,
T
>
;
toMaybe
(
)
:
Maybe
<
T
>
;
toPromise
(
)
:
Promise
<
T
>
;
toValidation
(
)
:
Validation
<
E
,
T
>
;
}
Type Parameters
E
T
Hierarchy-Diagram
Legend
interface
public method
Hierarchy (
view full
)
IMonad
<
T
>
Setoid
<
Either
<
E
,
T
>
>
ITraversable
<
T
>
Catamorphism
<
E
,
T
>
Either
Index
Properties
@@type
Methods
ap
ap
To
bimap
bind
cata
catch
Map
chain
equals
fantasy-
land/ap?
fantasy-
land/chain?
fantasy-
land/equals?
fantasy-
land/map?
flat
Map
fold
fold
Left
fold
Right
for
Each
for
Each
Left
is
Left
is
Right
join
left
left
Map
map
right
swap
take
Left
take
Right
to
Maybe
to
Promise
to
Validation
Properties
@@type
@@type
:
string
Methods
ap
ap
<
V
>
(
eitherFn
:
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
Either
<
E
,
V
>
Type Parameters
V
Parameters
eitherFn
:
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
Returns
Either
<
E
,
V
>
ap
To
ap
To
<
V
>
(
value
:
Either
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
Type Parameters
V
Parameters
value
:
Either
<
E
,
V
>
Returns
T
extends
(
(
arg
:
V
)
=>
any
)
?
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
bimap
bimap
<
Z
,
V
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
V
)
)
:
Either
<
Z
,
V
>
Type Parameters
Z
V
Parameters
leftFn
:
(
(
err
:
E
)
=>
Z
)
(
err
:
E
)
:
Z
Parameters
err
:
E
Returns
Z
rightFn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
Either
<
Z
,
V
>
bind
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
(
val
:
T
)
:
Either
<
E
,
V
>
Parameters
val
:
T
Returns
Either
<
E
,
V
>
Returns
Either
<
E
,
V
>
cata
cata
<
Z
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
Type Parameters
Z
Parameters
leftFn
:
(
(
err
:
E
)
=>
Z
)
(
err
:
E
)
:
Z
Parameters
err
:
E
Returns
Z
rightFn
:
(
(
val
:
T
)
=>
Z
)
(
val
:
T
)
:
Z
Parameters
val
:
T
Returns
Z
Returns
Z
catch
Map
catch
Map
<
F
>
(
fn
:
(
(
err
:
E
)
=>
Either
<
F
,
T
>
)
)
:
Either
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
err
:
E
)
=>
Either
<
F
,
T
>
)
(
err
:
E
)
:
Either
<
F
,
T
>
Parameters
err
:
E
Returns
Either
<
F
,
T
>
Returns
Either
<
F
,
T
>
chain
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
(
val
:
T
)
:
Either
<
E
,
V
>
Parameters
val
:
T
Returns
Either
<
E
,
V
>
Returns
Either
<
E
,
V
>
equals
equals
(
other
:
Either
<
E
,
T
>
)
:
boolean
Parameters
other
:
Either
<
E
,
T
>
Returns
boolean
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
:
Either
<
E
,
T
>
)
:
boolean
Parameters
other
:
Either
<
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
)
=>
Either
<
E
,
V
>
)
)
:
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
Either
<
E
,
V
>
)
(
val
:
T
)
:
Either
<
E
,
V
>
Parameters
val
:
T
Returns
Either
<
E
,
V
>
Returns
Either
<
E
,
V
>
fold
fold
<
Z
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
Type Parameters
Z
Parameters
leftFn
:
(
(
err
:
E
)
=>
Z
)
(
err
:
E
)
:
Z
Parameters
err
:
E
Returns
Z
rightFn
:
(
(
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
Left
for
Each
Left
(
fn
:
(
(
val
:
E
)
=>
void
)
)
:
void
Parameters
fn
:
(
(
val
:
E
)
=>
void
)
(
val
:
E
)
:
void
Parameters
val
:
E
Returns
void
Returns
void
is
Left
is
Left
(
)
:
boolean
Returns
boolean
is
Right
is
Right
(
)
:
boolean
Returns
boolean
join
join
<
V
>
(
)
:
Either
<
E
,
V
>
Type Parameters
V
Returns
Either
<
E
,
V
>
left
left
(
)
:
E
Returns
E
left
Map
left
Map
<
F
>
(
fn
:
(
(
leftVal
:
E
)
=>
F
)
)
:
Either
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
leftVal
:
E
)
=>
F
)
(
leftVal
:
E
)
:
F
Parameters
leftVal
:
E
Returns
F
Returns
Either
<
F
,
T
>
map
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
Either
<
E
,
V
>
right
right
(
)
:
T
Returns
T
swap
swap
(
)
:
Either
<
T
,
E
>
Returns
Either
<
T
,
E
>
take
Left
take
Left
(
m
:
Either
<
E
,
T
>
)
:
Either
<
E
,
T
>
Parameters
m
:
Either
<
E
,
T
>
Returns
Either
<
E
,
T
>
take
Right
take
Right
(
m
:
Either
<
E
,
T
>
)
:
Either
<
E
,
T
>
Parameters
m
:
Either
<
E
,
T
>
Returns
Either
<
E
,
T
>
to
Maybe
to
Maybe
(
)
:
Maybe
<
T
>
Returns
Maybe
<
T
>
to
Promise
to
Promise
(
)
:
Promise
<
T
>
Returns
Promise
<
T
>
to
Validation
to
Validation
(
)
:
Validation
<
E
,
T
>
Returns
Validation
<
E
,
T
>
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
On This Page
@@type
ap
ap
To
bimap
bind
cata
catch
Map
chain
equals
fantasy-
land/ap
fantasy-
land/chain
fantasy-
land/equals
fantasy-
land/map
flat
Map
fold
fold
Left
fold
Right
for
Each
for
Each
Left
is
Left
is
Right
join
left
left
Map
map
right
swap
take
Left
take
Right
to
Maybe
to
Promise
to
Validation
Official Cockpit API Documentation
Houston Common Library
Loading...
Either