new Bifunctor(value1, value2)
Bifunctor class; Mostly useful for eithers and/or maybes.
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
* | |
value2 |
* |
Properties:
| Name | Type | Description |
|---|---|---|
value |
* | |
value2 |
* |
Extends
Methods
-
bimap(fn1, fn2) → {Bifunctor}
-
Allows you to map 2 functions over contained values - One function over each value.
Parameters:
Name Type Description fn1function Unary op.
fn2function Unary op.
Returns:
Bifunctor -
first(fn) → {Bifunctor}
-
Allows you to map over first 'contained' value.
Parameters:
Name Type Description fnfunction Unary operation.
Returns:
Bifunctor -
fmap(fn) → {Functor}
-
Same as
#Functor.map.Parameters:
Name Type Description fnfunction Returns:
Functor- Inherited From:
-
map(fn) → {Functor}
-
Maps a function over contents of functor.
Parameters:
Name Type Description fnfunction Function that takes one
anyand returns oneany.Returns:
Functor- Inherited From:
-
second(fn) → {Bifunctor}
-
Allows you to map over second 'contained' value.
Parameters:
Name Type Description fnfunction Unary operation.
Returns:
Bifunctor -
value2Of() → {*}
-
Returns wrapped 'second' value.
Returns:
* -
valueOf() → {*}
-
Extracts value of functor (same as monadic
join).Returns:
*- Inherited From: