Adjoins the elements of this Coproduct
by flattening any Coproduct
elements.
Permutes this Coproduct
into the same order as another Coproduct
.
Permutes this Coproduct
into the same order as another Coproduct
. Available only if
both Coproduct
s have elements of the same types.
Permutes this Coproduct
into the same order as another Coproduct
.
Permutes this Coproduct
into the same order as another Coproduct
. An explicit type argument must be supplied.
Available only if both Coproduct
s have elements of the same types.
Returns the nth element of this Coproduct
.
Returns the nth element of this Coproduct
.
Available only if there is evidence that this Coproduct
has at least n elements.
Returns the nth element of this Coproduct
.
Returns the nth element of this Coproduct
. An explicit type must be provided.
Available only if there is evidence that this Coproduct
has at least n elements.
De-embeds a sub-Coproduct
from this Coproduct
if possible.
Drops the first n
elements of this Coproduct
.
Drops the first n
elements of this Coproduct
. Available only if
there is evidence that this Coproduct
has at least n elements.
Drops the first n
elements of this Coproduct
.
Drops the first n
elements of this Coproduct
. An explicit type argument must be provided. Available only if
there is evidence that this Coproduct
has at least n elements.
Embeds this Coproduct
into a "bigger" Coproduct
if possible.
Embeds this Coproduct
into a "bigger" Coproduct
if possible.
For instance, Int :+: String :+: CNil
can be embedded in Int :+: Bool :+: String :+: CNil
.
Extend this Coproduct
on the left.
Extend this Coproduct
on the left.
Extend this Coproduct
on the right.
Extend this Coproduct
on the right.
Returns all elements of type U
of this Coproduct
.
Returns all elements of type U
of this Coproduct
. An explicit type argument must be provided.
Returns all elements of type different than U
of this Coproduct
.
Returns all elements of type different than U
of this Coproduct
. An explicit type argument must be provided.
Flatmaps a higher rank function across this Coproduct
.
Computes a fold over this Coproduct
using the higher ranked function f
.
Computes a fold over this Coproduct
using the higher ranked function f
. Available only if
there is evidence f
can be applied all the elements of this Coproduct
.
Computes a left fold over this Coproduct
using the polymorphic binary combining operator op
.
Returns the head of this Coproduct
Returns index of A in this 'Coproduct'
Returns all elements except the last
Returns the last element of this 'Coproduct'
Compute the length of this Coproduct
.
Maps a higher rank function across this Coproduct
.
Returns the first element of type U
of this Coproduct
plus the remainder of the Coproduct
.
Returns the first element of type U
of this Coproduct
plus the remainder of the Coproduct
.
An explicit type argument must be provided. Available only if there is evidence that this
Coproduct
has an element of type U
.
Returns the first element of type U
of this Coproduct
plus the remainder of the Coproduct
.
Returns the first element of type U
of this Coproduct
plus the remainder of the Coproduct
.
An explicit type argument must be provided. Available only if there is evidence that this
Coproduct
has an element of type U
.
Reverses this Coproduct
.
Rotate this 'Coproduct' left by n
Rotate this 'Coproduct' left by N.
Rotate this 'Coproduct' left by N. An explicit type argument must be provided.
Rotate this 'Coproduct' right by n
Rotate this 'Coproduct' right by N.
Rotate this 'Coproduct' right by N. An explicit type argument must be provided.
Returns the first element of type U
of this Coproduct
.
Returns the first element of type U
of this Coproduct
. An explicit type argument must be provided. Available
only if there is evidence that this Coproduct
has an element of type U
.
Splits this Coproduct
at the nth element, returning the prefix and suffix as a pair.
Splits this Coproduct
at the nth element, returning the prefix and suffix as a pair. Available only if
there is evidence that this Coproduct
has at least n elements.
Splits this Coproduct
at the nth element, returning the prefix and suffix as a pair.
Splits this Coproduct
at the nth element, returning the prefix and suffix as a pair. An explicit type
argument must be provided. Available only if there is evidence that this Coproduct
has at least n elements.
Returns the tail of this Coproduct
Takes the first n
elements of this Coproduct
.
Takes the first n
elements of this Coproduct
. Available only if
there is evidence that this Coproduct
has at least n elements.
Takes the first n
elements of this Coproduct
.
Takes the first n
elements of this Coproduct
. An explicit type argument must be provided. Available only if
there is evidence that this Coproduct
has at least n elements.
Embeds this Coproduct
into an Either
Returns the value of this Coproduct
, typed as the least upper bound of this Coproduct
elements' types
Zips this Coproduct
with the given constant, resulting in a Coproduct
of tuples of the form
({element from this Coproduct
}, {supplied constant})
Zips this Coproduct
with the provided HList
, resulting in a Coproduct
of tuples of the form
({element from this Coproduct
}, {element from input HList
}).
Zips this Coproduct
with its element indices, resulting in a Coproduct
of tuples of the form
({element from input tuple}, {element index})
Converts this Coproduct
of values into a union with given keys.
Converts this Coproduct
of values into a union with given keys. A type argument must be provided.
Converts this Coproduct
of values into a union with the provided keys.
Carrier for
Coproduct
operations.These methods are implemented here and extended onto the minimal
Coproduct
types to avoid issues that would otherwise be caused by the covariance of:+:[H, T]
.