Returns the elements of this HList
specified by Ids
.
Returns the elements of this HList
specified by Ids
. Available only if there is
evidence that this HList
contains all elements specified in Ids
.
Append the argument HList
to this HList
.
Prepend the argument HList
to this HList
.
Prepend the argument element to this HList
.
Append the argument element to this HList
.
Prepend the argument element to this HList
.
Prepend the argument HList
to this HList
.
Adjoins the elements of this HList
by flattening any HList
elements.
Permutes this HList
into the same order as the supplied HList
with the same element types.
Permutes this HList
into the same order as the supplied HList
with the same element types. Available only if
both HList
s have elements of the same types.
Permutes this HList
into the same order as another HList
.
Permutes this HList
into the same order as another HList
. An explicit type argument must be supplied.
Available only if both HList
s have elements of the same types.
Returns the nth element of this HList
.
Returns the nth element of this HList
. Available only if there is evidence that this HList
has at least n
elements.
Returns the nth element of this HList
.
Returns the nth element of this HList
. An explicit type argument must be provided. Available only if there is
evidence that this HList
has at least n elements.
Returns the nth element of this HList
.
Returns the nth element of this HList
. Available only if there is evidence that this HList
has at least n
elements.
Returns the nth element of this HList
.
Returns the nth element of this HList
. An explicit type argument must be provided. Available only if there is
evidence that this HList
has at least n elements.
Collect a higher rank function across this HList
.
Finds the first element of the HList for which the given Poly is defined, and applies the Poly to it.
Returns all combinations of exactly length N
of elements from this Hlist
Returns the difference between this HList
and another HList
.
Returns the difference between this HList
and another HList
. In case of duplicate types, this operation is a
multiset difference. If type T
appears n times in this HList
and m < n times in M
, the resulting HList
contains the last n - m elements of type T
in this HList
.
Also available if M
contains types absent in this HList
.
Returns all but the first n elements of this HList
.
Returns all but the first n elements of this HList
. Available only if there is evidence that this HList
has at least n elements.
Returns all but the first n elements of this HList
.
Returns all but the first n elements of this HList
. An explicit type argument must be provided. Available
only if there is evidence that this HList
has at least n elements.
Returns all elements of type U
of this HList
.
Returns all elements of type U
of this HList
. An explicit type argument must be provided.
Returns all elements of type different than U
of this HList
.
Returns all elements of type different than U
of this HList
. An explicit type argument must be provided.
Flatmaps a higher rank function across this HList
.
Computes a left fold over this HList
using the polymorphic binary combining operator op
.
Computes a left fold over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence op
can consume/produce all the partial results of the appropriate types.
Maps a higher rank function f across this HList
and folds the result using monomorphic combining operator
op
.
Maps a higher rank function f across this HList
and folds the result using monomorphic combining operator
op
. Available only if there is evidence that the result type of f
at each element conforms to the argument
type of op.
Computes a right fold over this HList
using the polymorphic binary combining operator op
.
Computes a right fold over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence op
can consume/produce all the partial results of the appropriate types.
Groups the elements of this HList
into tuples of n
elements, offset by step
Use elements in pad
as necessary to complete last group up to n
items.
Groups the elements of this HList
into tuples of n
elements, offset by step
Returns the head of this HList
.
Returns the head of this HList
. Available only if there is evidence that this HList
is composite.
Returns an HList
consisting of all the elements of this HList
except the last.
Returns an HList
consisting of all the elements of this HList
except the last. Available only if there is
evidence that this HList
is composite.
Returns the intersection between this HList
and another HList
.
Returns the intersection between this HList
and another HList
. In case of duplicate types, this operation is a
multiset intersection. If type T
appears n times in this HList
and m < n times in M
, the resulting HList
contains the first m elements of type T
in this HList
.
Also available if M
contains types absent in this HList
.
Returns the last element of this HList
.
Returns the last element of this HList
. Available only if there is evidence that this HList
is composite.
Compute the length of this HList
.
Maps a higher rank function across this HList
.
Conses an element onto each row of this HMatrix (HList of HLists).
Replaces each element of this HList
with a constant value.
Displays all elements of this hlist in a string using start, end, and separator strings.
Appends elem
until a given length N
is reached.
Produces a new HList
where a slice of this HList
is replaced by another.
Produces a new HList
where a slice of this HList
is replaced by another. Two explicit type arguments must be
provided. Available only if there are at least N
plus M
elements.
Produces a new HList
where a slice of this HList
is replaced by another.
Produces a new HList
where a slice of this HList
is replaced by another. Available only if there are at least
plus n
elements.
m
Returns all permutations of this 'HList'
Computes a left reduce over this HList
using the polymorphic binary combining operator op
.
Computes a left reduce over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence that this HList
has at least one element and that op
can consume/produce all the partial
results of the appropriate types.
Computes a right reduce over this HList
using the polymorphic binary combining operator op
.
Computes a right reduce over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence that this HList
has at least one element and that op
can consume/produce all the partial
results of the appropriate types.
Reinserts an element U
into this HList
to return another HList
O
.
Reinserts the elements of SL
into this HList
to return another HList
O
.
Returns the first elements of this HList
that have types in SL
plus the remainder of the HList
.
Returns the first elements of this HList
that have types in SL
plus the remainder of the HList
. An expicit
type argument must be provided. Available only if there is evidence that this HList
contains elements with
types in SL
.
Returns the first element of type U
of this HList
plus the remainder of the HList
.
Returns the first element of type U
of this HList
plus the remainder of the HList
. An explicit type argument
must be provided. Available only if there is evidence that this HList
has an element of type U
.
The Elem
suffix is here to avoid creating an ambiguity with RecordOps#remove and should be removed if
SI-5414 is resolved in a way which eliminates the ambiguity.
Repeats this HList
N times.
Replaces the first element of type U
of this HList
with the supplied value, also of type U
returning both
the replaced element and the updated HList
.
Replaces the first element of type U
of this HList
with the supplied value, also of type U
returning both
the replaced element and the updated HList
. Available only if there is evidence that this HList
has an element
of type U
.
Replaces the first element of type U
of this HList
with the supplied value of type V
, returning both the
replaced element and the updated HList
.
Replaces the first element of type U
of this HList
with the supplied value of type V
, returning both the
replaced element and the updated HList
. An explicit type argument must be provided for U
. Available only if
there is evidence that this HList
has an element of type U
.
Reverses this HList
.
Prepend the reverse of the argument HList
to this HList
.
Splits this HList
at the nth element, returning the reverse of the prefix and suffix as a pair.
Splits this HList
at the nth element, returning the reverse of the prefix and suffix as a pair. Available
only if there is evidence that this HList
has at least n elements.
Splits this HList
at the nth element, returning the reverse of the prefix and suffix as a pair.
Splits this HList
at the nth element, returning the reverse of the prefix and suffix as a pair. An explicit
type argument must be provided. Available only if there is evidence that this HList
has at least n elements.
Splits this HList
at the first occurrence of an element of type U
, returning reverse of the prefix and suffix
as a pair.
Splits this HList
at the first occurrence of an element of type U
, returning reverse of the prefix and suffix
as a pair. An explicit type argument must be provided. Available only if there is evidence that this HList
has
an element of type U
.
Splits this HList
at the last occurrence of an element of type U
, returning reverse of the prefix and suffix
as a pair.
Splits this HList
at the last occurrence of an element of type U
, returning reverse of the prefix and suffix
as a pair. An explicit type argument must be provided. Available only if there is evidence that this HList
has
an element of type U
.
Rotate this 'HList' left by N
Rotate this 'HList' left by N.
Rotate this 'HList' left by N. An explicit type argument must be provided.
Rotate this 'HList' right by N
Rotate this 'HList' right by N.
Rotate this 'HList' right by N. An explicit type argument must be provided.
Compute the length of this HList
as a runtime Int value.
Convert this HList
to a List[Any]
.
Computes a left scan over this HList
using the polymorphic binary combining operator op
.
Computes a left scan over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence op
can consume/produce all the results of the appropriate types.
Computes a right scan over this HList
using the polymorphic binary combining operator op
.
Computes a right scan over this HList
using the polymorphic binary combining operator op
. Available only if
there is evidence op
can consume/produce all the results of the appropriate types.
Returns the first element of type U
of this HList
.
Returns the first element of type U
of this HList
. An explicit type argument must be provided. Available only
if there is evidence that this HList
has an element of type U
.
Returns the elements of this HList
specified by the range of ids in [A,B[
Available only if there is evidence that this HList
contains all elements in that range
Slices beginning at index from
and afterwards, up until index until
Splits this HList
at the nth element, returning the prefix and suffix as a pair.
Splits this HList
at the nth element, returning the prefix and suffix as a pair. Available only if there is
evidence that this HList
has at least n elements.
Splits this HList
at the nth element, returning the prefix and suffix as a pair.
Splits this HList
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 HList
has at least n elements.
Splits this HList
at the first occurrence of an element of type U
, returning the prefix and suffix as a pair.
Splits this HList
at the first occurrence of an element of type U
, returning the prefix and suffix as a pair.
An explicit type argument must be provided. Available only if there is evidence that this HList
has an element
of type U
.
Splits this HList
at the last occurrence of an element of type U
, returning the prefix and suffix as a pair.
Splits this HList
at the last occurrence of an element of type U
, returning the prefix and suffix as a pair.
An explicit type argument must be provided. Available only if there is evidence that this HList
has an element
of type U
.
Returns the tail of this HList
.
Returns the tail of this HList
. Available only if there is evidence that this HList
is composite.
Returns the first n elements of this HList
.
Returns the first n elements of this HList
. Available only if there is evidence that this HList
has at
least n elements.
Returns the first n elements of this HList
.
Returns the first n elements of this HList
. An explicit type argument must be provided. Available only if
there is evidence that this HList
has at least n elements.
Converts this HList
to a M
of elements typed as the least upper bound of the types of the elements
of this HList
.
Converts this HList
to an Array
of elements typed as the least upper bound of the types of the elements
of this HList
.
Converts this HList
to an Array
of elements typed as the least upper bound of the types of the elements
of this HList
.
It is advisable to specify the type parameter explicitly, because for many reference types, case classes in
particular, the inferred type will be too precise (ie. Product with Serializable with CC
for a typical case class
CC
) which interacts badly with the invariance of Array
s.
Converts this HList
to a M
of elements embedded in a minimal Coproduct
encompassing the types of every
elements of this HList
.
Converts this HList
to a M
of elements embedded in a minimal Coproduct
encompassing the types of every
elements of this HList
.
For example :
(1 :: "qux" :: 42 :: "bar" :: HNil).toCoproduct[Vector]
Would return a Vector[Int :+: String :+: CNil]
Note that the M
container must extend Traversable
, which means that Array
cannot be used.
Converts this HList
to an ordinary List
of elements typed as the least upper bound of the types of the elements
of this HList
.
Converts this HList
to a - sized - M
of elements typed as the least upper bound of the types of the elements
of this HList
.
Transposes this HList
.
Converts this HList
to a correspondingly typed tuple.
Returns an HList
typed as a repetition of the least upper bound of the types of the elements of this HList
.
Returns an HList
with all elements that are subtypes of B
typed as B
.
Returns the union between this HList
and another HList
.
Returns the union between this HList
and another HList
. In case of duplicate types, this operation is a
order-preserving multi-set union. If type T
appears n times in this HList
and m > n times in M
, the
resulting HList
contains the first n elements of type T
in this HList
, followed by the last m - n element
of type T
in M
.
Unzips this HList
of tuples returning a tuple of HList
s.
Unzips this HList
of tuples returning a tuple of HList
s. Available only if there is evidence that this
HList
has tuple elements.
Replaces the N
th element of this HList
with the result of calling the supplied function on it.
Replaces the N
th element of this HList
with the result of calling the supplied function on it.
Available only if there is evidence that this HList
has N
elements.
Replaces the first element of type U
of this HList
with the result of its transformation to a V
via the
supplied function.
Replaces the first element of type U
of this HList
with the result of its transformation to a V
via the
supplied function. Available only if there is evidence that this HList
has an element of type U
.
Replaces the nth' element of this HList
with the supplied value of type U
. Available only if there is
evidence that this HList
has at least n elements.
Replaces the nth' element of this HList
with the supplied value of type U
. An explicit type argument
must be provided for N
. Available only if there is evidence that this HList
has at least n elements.
Replaces the first element of type U
of this HList
with the supplied value, also of type U
.
Replaces the first element of type U
of this HList
with the supplied value, also of type U
. Available only
if there is evidence that this HList
has an element of type U
.
The Elem
suffix is here to avoid creating an ambiguity with RecordOps#updated and should be removed if
SI-5414 is resolved in a way which eliminates the ambiguity.
Replaces the first element of type U
of this HList
with the supplied value of type V
.
Replaces the first element of type U
of this HList
with the supplied value of type V
. An explicit type
argument must be provided for U
. Available only if there is evidence that this HList
has an element of
type U
.
Zips this HList
of HList
s returning an HList
of tuples.
Zips this HList
of HList
s returning an HList
of tuples. Available only if there is evidence that this
HList
has HList
elements.
Zips this HList
with its argument HList
returning an HList
of pairs.
Zips this HList
of monomorphic function values with its argument HList
of correspondingly typed function
arguments returning the result of each application as an HList
.
Zips this HList
of monomorphic function values with its argument HList
of correspondingly typed function
arguments returning the result of each application as an HList
. Available only if there is evidence that the
corresponding function and argument elements have compatible types.
Zips this HList
with a constant, resulting in an HList
of tuples of the form
({element from this HList
}, {supplied constant})
Zips this HList
with its argument HList
of HList
s, returning an HList
of HList
s with each element of
this HList
prepended to the corresponding HList
element of the argument HList
.
Zips this 'HList' with its argument 'HList' using argument 'Poly2', returning an 'HList'.
Zips this 'HList' with its argument 'HList' using argument 'Poly2', returning an 'HList'. Doesn't require this to be the same length as its 'HList' argument, but does require evidence that its 'Poly2' argument is defined at their intersection.
Zips this HList
with its element indices, resulting in a 'HList' of tuples of the form
({element from input tuple}, {element index})
Converts this HList
of values into a record with given keys.
Converts this HList
of values into a record with given keys. A type argument must be provided.
Converts this HList
of values into a record with the provided keys.
Unzips this HList
of tuples returning a tuple of HList
s.
Unzips this HList
of tuples returning a tuple of HList
s. Available only if there is evidence that this
HList
has tuple elements.
(Since version 2.0.0) Use unzip instead
Zips this HList
of HList
s returning an HList
of tuples.
Zips this HList
of HList
s returning an HList
of tuples. Available only if there is evidence that this
HList
has HList
elements.
(Since version 2.0.0) Use zip instead
Carrier for
HList
operations.These methods are implemented here and pimped onto the minimal
HList
types to avoid issues that would otherwise be caused by the covariance of::[H, T]
.