Preparing search index...
The search index is not available
Houston Common Library
Houston Common Library
@45drives/houston-common-lib
monet
Either
Interface Either<E, T>
Either
interface
Either
<
E
,
T
>
{
@@type
:
string
;
ap
<
V
>
(
eitherFn
:
monet
.
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
monet
.
Either
<
E
,
V
>
;
apTo
<
V
>
(
value
:
monet
.
Either
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
monet
.
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
;
bimap
<
Z
,
V
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
Either
<
Z
,
V
>
;
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
Either
<
E
,
V
>
;
cata
<
Z
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
Z
)
)
:
Z
;
catchMap
<
F
>
(
fn
:
(
(
err
:
E
)
=>
monet
.
Either
<
F
,
T
>
)
)
:
monet
.
Either
<
F
,
T
>
;
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
Either
<
E
,
V
>
;
equals
(
other
:
monet
.
Either
<
E
,
T
>
)
:
boolean
;
fantasy-land/ap
?
<
V
>
(
afn
:
monet
.
Applicative
<
(
(
val
:
T
)
=>
V
)
>
)
:
monet
.
Applicative
<
V
>
;
fantasy-land/chain
?
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Chain
<
V
>
)
)
:
monet
.
Chain
<
V
>
;
fantasy-land/equals
?
(
other
:
monet
.
Either
<
E
,
T
>
)
:
boolean
;
fantasy-land/map
?
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
Functor
<
V
>
;
flatMap
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
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
>
(
)
:
monet
.
Either
<
E
,
V
>
;
left
(
)
:
E
;
leftMap
<
F
>
(
fn
:
(
(
leftVal
:
E
)
=>
F
)
)
:
monet
.
Either
<
F
,
T
>
;
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
Either
<
E
,
V
>
;
right
(
)
:
T
;
swap
(
)
:
monet
.
Either
<
T
,
E
>
;
takeLeft
(
m
:
monet
.
Either
<
E
,
T
>
)
:
monet
.
Either
<
E
,
T
>
;
takeRight
(
m
:
monet
.
Either
<
E
,
T
>
)
:
monet
.
Either
<
E
,
T
>
;
toMaybe
(
)
:
monet
.
Maybe
<
T
>
;
toPromise
(
)
:
Promise
<
T
>
;
toValidation
(
)
:
monet
.
Validation
<
E
,
T
>
;
}
Type Parameters
E
T
Hierarchy-Diagram
Legend
interface
public method
Hierarchy (
view full
)
monet
.
IMonad
<
T
>
monet
.
Setoid
<
monet
.
Either
<
E
,
T
>
>
monet
.
ITraversable
<
T
>
monet
.
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
:
monet
.
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Parameters
eitherFn
:
monet
.
Either
<
E
,
(
(
val
:
T
)
=>
V
)
>
Returns
monet
.
Either
<
E
,
V
>
ap
To
ap
To
<
V
>
(
value
:
monet
.
Either
<
E
,
V
>
)
:
T
extends
(
(
arg
:
V
)
=>
any
)
?
monet
.
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
Type Parameters
V
Parameters
value
:
monet
.
Either
<
E
,
V
>
Returns
T
extends
(
(
arg
:
V
)
=>
any
)
?
monet
.
Either
<
E
,
ReturnType
<
T
<
T
>
>
>
:
never
bimap
bimap
<
Z
,
V
>
(
leftFn
:
(
(
err
:
E
)
=>
Z
)
,
rightFn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
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
monet
.
Either
<
Z
,
V
>
bind
bind
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
(
val
:
T
)
:
monet
.
Either
<
E
,
V
>
Parameters
val
:
T
Returns
monet
.
Either
<
E
,
V
>
Returns
monet
.
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
)
=>
monet
.
Either
<
F
,
T
>
)
)
:
monet
.
Either
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
err
:
E
)
=>
monet
.
Either
<
F
,
T
>
)
(
err
:
E
)
:
monet
.
Either
<
F
,
T
>
Parameters
err
:
E
Returns
monet
.
Either
<
F
,
T
>
Returns
monet
.
Either
<
F
,
T
>
chain
chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
(
val
:
T
)
:
monet
.
Either
<
E
,
V
>
Parameters
val
:
T
Returns
monet
.
Either
<
E
,
V
>
Returns
monet
.
Either
<
E
,
V
>
equals
equals
(
other
:
monet
.
Either
<
E
,
T
>
)
:
boolean
Parameters
other
:
monet
.
Either
<
E
,
T
>
Returns
boolean
Optional
fantasy-
land/ap
fantasy-
land/ap
<
V
>
(
afn
:
monet
.
Applicative
<
(
(
val
:
T
)
=>
V
)
>
)
:
monet
.
Applicative
<
V
>
Type Parameters
V
Parameters
afn
:
monet
.
Applicative
<
(
(
val
:
T
)
=>
V
)
>
Returns
monet
.
Applicative
<
V
>
Optional
fantasy-
land/chain
fantasy-
land/chain
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Chain
<
V
>
)
)
:
monet
.
Chain
<
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
monet
.
Chain
<
V
>
)
(
val
:
T
)
:
monet
.
Chain
<
V
>
Parameters
val
:
T
Returns
monet
.
Chain
<
V
>
Returns
monet
.
Chain
<
V
>
Optional
fantasy-
land/equals
fantasy-
land/equals
(
other
:
monet
.
Either
<
E
,
T
>
)
:
boolean
Parameters
other
:
monet
.
Either
<
E
,
T
>
Returns
boolean
Optional
fantasy-
land/map
fantasy-
land/map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
Functor
<
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
monet
.
Functor
<
V
>
flat
Map
flat
Map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
monet
.
Either
<
E
,
V
>
)
(
val
:
T
)
:
monet
.
Either
<
E
,
V
>
Parameters
val
:
T
Returns
monet
.
Either
<
E
,
V
>
Returns
monet
.
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
>
(
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Returns
monet
.
Either
<
E
,
V
>
left
left
(
)
:
E
Returns
E
left
Map
left
Map
<
F
>
(
fn
:
(
(
leftVal
:
E
)
=>
F
)
)
:
monet
.
Either
<
F
,
T
>
Type Parameters
F
Parameters
fn
:
(
(
leftVal
:
E
)
=>
F
)
(
leftVal
:
E
)
:
F
Parameters
leftVal
:
E
Returns
F
Returns
monet
.
Either
<
F
,
T
>
map
map
<
V
>
(
fn
:
(
(
val
:
T
)
=>
V
)
)
:
monet
.
Either
<
E
,
V
>
Type Parameters
V
Parameters
fn
:
(
(
val
:
T
)
=>
V
)
(
val
:
T
)
:
V
Parameters
val
:
T
Returns
V
Returns
monet
.
Either
<
E
,
V
>
right
right
(
)
:
T
Returns
T
swap
swap
(
)
:
monet
.
Either
<
T
,
E
>
Returns
monet
.
Either
<
T
,
E
>
take
Left
take
Left
(
m
:
monet
.
Either
<
E
,
T
>
)
:
monet
.
Either
<
E
,
T
>
Parameters
m
:
monet
.
Either
<
E
,
T
>
Returns
monet
.
Either
<
E
,
T
>
take
Right
take
Right
(
m
:
monet
.
Either
<
E
,
T
>
)
:
monet
.
Either
<
E
,
T
>
Parameters
m
:
monet
.
Either
<
E
,
T
>
Returns
monet
.
Either
<
E
,
T
>
to
Maybe
to
Maybe
(
)
:
monet
.
Maybe
<
T
>
Returns
monet
.
Maybe
<
T
>
to
Promise
to
Promise
(
)
:
Promise
<
T
>
Returns
Promise
<
T
>
to
Validation
to
Validation
(
)
:
monet
.
Validation
<
E
,
T
>
Returns
monet
.
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