Contents
- CoproductExtensions
- Match <F, A, B, C> (this K<F, A, B> fab, Func<A, C> Left, Func<B, C> Right)
- Match <F, A, B, C> (this K<F, A, B> fab, C Left, Func<B, C> Right)
- Match <F, A, B, C> (this K<F, A, B> fab, Func<A, C> Left, C Right)
- IfLeft <F, A, B> (this K<F, A, B> fab, Func<A, B> Left)
- IfLeft <F, A, B> (this K<F, A, B> fab, B Left)
- IfRight <F, A, B> (this K<F, A, B> fab, Func<B, A> Right)
- IfRight <F, A, B> (this K<F, A, B> fab, A Right)
- Partition <FF, F, A, B> (this K<FF, K<F, A, B>> fabs)
- PartitionSequence <F, A, B> (this IEnumerable<K<F, A, B>> fabs)
- Coproduct
- left <F, A, B> (A value)
- right <F, A, B> (B value)
- partition <FF, F, A, B> (K<FF, K<F, A, B>> fabs)
- partitionSequence <F, A, B> (IEnumerable<K<F, A, B>> fabs)
- Coproduct <F>
- Match <A, B, C> (Func<A, C> Left, Func<B, C> Right, K<F, A, B> fab)
- Match <A, B, C> (C Left, Func<B, C> Right, K<F, A, B> fab)
- Match <A, B, C> (Func<A, C> Left, C Right, K<F, A, B> fab)
- IfLeft <A, B> (Func<A, B> Left, K<F, A, B> fab)
- IfLeft <A, B> (B Left, K<F, A, B> fab)
- IfRight <A, B> (Func<B, A> Right, K<F, A, B> fab)
- IfRight <A, B> (A Right, K<F, A, B> fab)
- Partition <FF, A, B> (K<FF, K<F, A, B>> fabs)
- Lefts <G, A, B> (K<G, K<F, A, B>> fabs)
- Rights <G, A, B> (K<G, K<F, A, B>> fabs)
class CoproductExtensions Source #
Co-product trait (abstract version of Either)
Parameters
| type | F | Self |
Methods
method C Match <F, A, B, C> (this K<F, A, B> fab, Func<A, C> Left, Func<B, C> Right) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method C Match <F, A, B, C> (this K<F, A, B> fab, C Left, Func<B, C> Right) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method C Match <F, A, B, C> (this K<F, A, B> fab, Func<A, C> Left, C Right) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method B IfLeft <F, A, B> (this K<F, A, B> fab, Func<A, B> Left) Source #
Pattern-match the left value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| returns | Either the right value or the result of mapping the left with the function provided | |
method B IfLeft <F, A, B> (this K<F, A, B> fab, B Left) Source #
Pattern-match the left value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Left | Default value to use if the state is |
| returns | Either the right value or provided | |
method A IfRight <F, A, B> (this K<F, A, B> fab, Func<B, A> Right) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Right | Function to map the right value to a result |
| returns | Either the left value or the result of mapping the right value with the function provided | |
method A IfRight <F, A, B> (this K<F, A, B> fab, A Right) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Right | Default value to use if the state is |
| returns | Either the left value or provided | |
method (Seq<A> Lefts, Seq<B> Rights) Partition <FF, F, A, B> (this K<FF, K<F, A, B>> fabs) Source #
Partition the foldable of coproducts into two left and right sequences.
Parameters
| type | A | Left value type |
| type | B | Right value type |
| returns | Two left and right sequences | |
method (Seq<A> Lefts, Seq<B> Rights) PartitionSequence <F, A, B> (this IEnumerable<K<F, A, B>> fabs) Source #
Partition the foldable of coproducts into two left and right sequences.
Parameters
| type | A | Left value type |
| type | B | Right value type |
| returns | Two left and right sequences | |
Methods
method K<F, A, B> left <F, A, B> (A value) Source #
Construct a coproduct structure in a 'Left' state
Parameters
| type | A | Left value type |
| type | B | Right value type |
| param | value | Left value |
| returns | Constructed coproduct structure | |
method K<F, A, B> right <F, A, B> (B value) Source #
Construct a coproduct structure in a 'Left' state
Parameters
| type | A | Left value type |
| type | B | Right value type |
| param | value | Left value |
| returns | Constructed coproduct structure | |
method (Seq<A> Lefts, Seq<B> Rights) partition <FF, F, A, B> (K<FF, K<F, A, B>> fabs) Source #
Partition the foldable of coproducts into two left and right sequences.
Parameters
| type | A | Left value type |
| type | B | Right value type |
| returns | Two left and right sequences | |
method (Seq<A> Lefts, Seq<B> Rights) partitionSequence <F, A, B> (IEnumerable<K<F, A, B>> fabs) Source #
Partition the foldable of coproducts into two left and right sequences.
Parameters
| type | A | Left value type |
| type | B | Right value type |
| returns | Two left and right sequences | |
interface Coproduct <F> Source #
Co-product trait (abstract version of Either)
Parameters
| type | F | Self |
Methods
method C Match <A, B, C> (Func<A, C> Left, Func<B, C> Right, K<F, A, B> fab) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method C Match <A, B, C> (C Left, Func<B, C> Right, K<F, A, B> fab) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method C Match <A, B, C> (Func<A, C> Left, C Right, K<F, A, B> fab) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| type | C | Result type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| param | Right | Function to map the right value to a result |
| returns | Result of mapping either the left or right values with the functions provided | |
method B IfLeft <A, B> (Func<A, B> Left, K<F, A, B> fab) Source #
Pattern-match the left value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Left | Function to map the left value to a result |
| returns | Either the right value or the result of mapping the left with the function provided | |
method B IfLeft <A, B> (B Left, K<F, A, B> fab) Source #
Pattern-match the left value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Left | Default value to use if the state is |
| returns | Either the right value or provided | |
method A IfRight <A, B> (Func<B, A> Right, K<F, A, B> fab) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Right | Function to map the right value to a result |
| returns | Either the left value or the result of mapping the right value with the function provided | |
method A IfRight <A, B> (A Right, K<F, A, B> fab) Source #
Pattern-match either the left or right value in the coproduct
Parameters
| type | F | Coproduct trait type |
| type | A | Left value type |
| type | B | Right value type |
| param | fab | Coproduct value |
| param | Right | Default value to use if the state is |
| returns | Either the left value or provided | |
method (Seq<A> Lefts, Seq<B> Rights) Partition <FF, A, B> (K<FF, K<F, A, B>> fabs) Source #
Partition the foldable of coproducts into two left and right sequences.
Parameters
| type | A | Left value type |
| type | B | Right value type |
| returns | Two left and right sequences | |