shapeless.syntax

HListOps

final class HListOps[L <: HList] extends AnyRef

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].

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HListOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HListOps(l: L)

Type Members

  1. class PatchAux[N <: Nat, M <: Nat] extends AnyRef

  2. class ReplaceTypeAux[U] extends AnyRef

  3. class UpdatedAtAux[N <: Nat] extends AnyRef

  4. class UpdatedTypeAux[U] extends AnyRef

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++[S <: HList](suffix: S)(implicit prepend: Prepend[L, S]): Out

    Append the argument HList to this HList.

  5. def ++:[P <: HList](prefix: P)(implicit prepend: Prepend[P, L]): Out

    Prepend the argument HList to this HList.

  6. def +:[H](h: H): ::[H, L]

    Prepend the argument element to this HList.

  7. def :+[T](t: T)(implicit prepend: Prepend[L, ::[T, HNil]]): Out

    Append the argument element to this HList.

  8. def ::[H](h: H): ::[H, L]

    Prepend the argument element to this HList.

  9. def :::[P <: HList](prefix: P)(implicit prepend: Prepend[P, L]): Out

    Prepend the argument HList to this HList.

  10. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  12. def align[M <: HList](m: M)(implicit align: Align[L, M]): M

    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 HLists have elements of the same types.

  13. def align[M <: HList](implicit align: Align[L, M]): M

    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 HLists have elements of the same types.

  14. def apply(n: Nat)(implicit at: At[L, N]): ops.hlist.At.Out

    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.

  15. def apply[N <: Nat](implicit at: At[L, N]): ops.hlist.At.Out

    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.

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def at(n: Nat)(implicit at: At[L, N]): ops.hlist.At.Out

    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.

  18. def at[N <: Nat](implicit at: At[L, N]): ops.hlist.At.Out

    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.

  19. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def collect(p: Poly)(implicit collect: Collect[L, p.type]): Out

    Collect a higher rank function across this HList.

  21. def drop(n: Nat)(implicit drop: Drop[L, N]): Out

    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.

  22. def drop[N <: Nat](implicit drop: Drop[L, N]): Out

    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.

  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  25. def filter[U](implicit partition: Partition[L, U]): Prefix

    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.

  26. def filterNot[U](implicit partition: Partition[L, U]): Suffix

    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.

  27. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def flatMap(f: Poly)(implicit mapper: FlatMapper[f.type, L]): Out

    Flatmaps a higher rank function across this HList.

  29. def foldLeft[R](z: R)(op: Poly)(implicit folder: LeftFolder[L, R, op.type]): ops.hlist.LeftFolder.Out

    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.

  30. def foldMap[R](z: R)(f: Poly)(op: (R, R) ⇒ R)(implicit folder: MapFolder[L, R, f.type]): R

    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.

  31. def foldRight[R](z: R)(op: Poly)(implicit folder: RightFolder[L, R, op.type]): ops.hlist.RightFolder.Out

    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.

  32. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  34. def head(implicit c: IsHCons[L]): H

    Returns the head of this HList.

    Returns the head of this HList. Available only if there is evidence that this HList is composite.

  35. def init(implicit init: Init[L]): Out

    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.

  36. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  37. def last(implicit last: Last[L]): ops.hlist.Last.Out

    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.

  38. def length(implicit length: Length[L]): Out

    Compute the length of this HList.

  39. def map(f: Poly)(implicit mapper: Mapper[f.type, L]): Out

    Maps a higher rank function across this HList.

  40. def mapCons[A](a: A)(implicit mapCons: MapCons[A, L]): Out

    Conses an element onto each row of this HMatrix (HList of HLists).

  41. def mapConst[C](c: C)(implicit mapper: ConstMapper[C, L]): Out

    Replaces each element of this HList with a constant value.

  42. def mkString(start: String, sep: String, end: String)(implicit toTraversable: Aux[L, List, Any]): String

    Displays all elements of this hlist in a string using start, end, and separator strings.

  43. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  44. final def notify(): Unit

    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  46. def partition[U](implicit partition: Partition[L, U]): (Prefix, Suffix)

  47. def partitionP[U](implicit partition: Partition[L, U]): ::[Prefix, ::[Suffix, HNil]]

  48. def patch[N <: Nat, M <: Nat]: PatchAux[N, M]

    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.

  49. def patch[In <: HList](n: Nat, in: In, m: Nat)(implicit patcher: Patcher[N, N, L, In]): Out

    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 n plus m elements.

  50. def permutations(implicit permutations: Permutations[L]): Out

    Returns all permutations of this 'HList'

  51. def reduceLeft(op: Poly)(implicit reducer: LeftReducer[L, op.type]): ops.hlist.LeftReducer.Out

    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.

  52. def reduceRight(op: Poly)(implicit reducer: RightReducer[L, op.type]): ops.hlist.RightReducer.Out

    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.

  53. def removeAll[SL <: HList](implicit removeAll: RemoveAll[L, SL]): ops.hlist.RemoveAll.Out

    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.

  54. def removeElem[U](implicit remove: Remove[L, U]): ops.hlist.Remove.Out

    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.

  55. def replace[U](u: U)(implicit replacer: Replacer[L, U, U]): ops.hlist.Replacer.Out

    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.

  56. def replaceType[U]: ReplaceTypeAux[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.

  57. def reverse(implicit reverse: Reverse[L]): Out

    Reverses this HList.

  58. def reverse_:::[P <: HList](prefix: P)(implicit prepend: ReversePrepend[P, L]): Out

    Prepend the reverse of the argument HList to this HList.

  59. def reverse_split(n: Nat)(implicit split: ReverseSplit[L, N]): (Prefix, Suffix)

    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.

  60. def reverse_split[N <: Nat](implicit split: ReverseSplit[L, N]): (Prefix, Suffix)

    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.

  61. def reverse_splitLeft[U](implicit split: ReverseSplitLeft[L, U]): (Prefix, Suffix)

    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.

  62. def reverse_splitLeftP[U](implicit split: ReverseSplitLeft[L, U]): ::[Prefix, ::[Suffix, HNil]]

  63. def reverse_splitP(n: Nat)(implicit split: ReverseSplit[L, N]): ::[Prefix, ::[Suffix, HNil]]

  64. def reverse_splitP[N <: Nat](implicit split: ReverseSplit[L, N]): ::[Prefix, ::[Suffix, HNil]]

  65. def reverse_splitRight[U](implicit split: ReverseSplitRight[L, U]): (Prefix, Suffix)

    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.

  66. def reverse_splitRightP[U](implicit split: ReverseSplitRight[L, U]): ::[Prefix, ::[Suffix, HNil]]

  67. def rotateLeft(n: Nat)(implicit rotateLeft: RotateLeft[L, N]): Out

    Rotate this 'HList' left by N

  68. def rotateLeft[N <: Nat](implicit rotateLeft: RotateLeft[L, N]): Out

    Rotate this 'HList' left by N.

    Rotate this 'HList' left by N. An explicit type argument must be provided.

  69. def rotateRight(n: Nat)(implicit rotateRight: RotateRight[L, N]): Out

    Rotate this 'HList' right by N

  70. def rotateRight[N <: Nat](implicit rotateRight: RotateRight[L, N]): Out

    Rotate this 'HList' right by N.

    Rotate this 'HList' right by N. An explicit type argument must be provided.

  71. def runtimeLength: Int

    Compute the length of this HList as a runtime Int value.

  72. def scanLeft[A, P <: Poly](z: A)(op: Poly)(implicit scanL: LeftScanner[L, A, op.type]): Out

    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.

  73. def scanRight[A, P <: Poly](z: A)(op: Poly)(implicit scanR: RightScanner[L, A, op.type]): Out

    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.

  74. def select[U](implicit selector: Selector[L, U]): U

    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.

  75. def split(n: Nat)(implicit split: Split[L, N]): (Prefix, Suffix)

    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.

  76. def split[N <: Nat](implicit split: Split[L, N]): (Prefix, Suffix)

    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.

  77. def splitLeft[U](implicit split: SplitLeft[L, U]): (Prefix, Suffix)

    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.

  78. def splitLeftP[U](implicit split: SplitLeft[L, U]): ::[Prefix, ::[Suffix, HNil]]

  79. def splitP(n: Nat)(implicit split: Split[L, N]): ::[Prefix, ::[Suffix, HNil]]

  80. def splitP[N <: Nat](implicit split: Split[L, N]): ::[Prefix, ::[Suffix, HNil]]

  81. def splitRight[U](implicit split: SplitRight[L, U]): (Prefix, Suffix)

    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.

  82. def splitRightP[U](implicit split: SplitRight[L, U]): ::[Prefix, ::[Suffix, HNil]]

  83. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  84. def tail(implicit c: IsHCons[L]): T

    Returns the tail of this HList.

    Returns the tail of this HList. Available only if there is evidence that this HList is composite.

  85. def take(n: Nat)(implicit take: Take[L, N]): Out

    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.

  86. def take[N <: Nat](implicit take: Take[L, N]): Out

    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.

  87. def to[M[_]](implicit ts: ToTraversable[L, M]): Out

    Converts this HList to a - sized - M of elements typed as the least upper bound of the types of the elements of this HList.

  88. def toArray[Lub](implicit toTraversableAux: Aux[L, Array, Lub]): (toTraversableAux)#Out

    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 Arrays.

  89. def toList[Lub](implicit toTraversableAux: Aux[L, List, Lub]): (toTraversableAux)#Out

    Converts this HList to an ordinary List of elements typed as the least upper bound of the types of the elements of this HList.

  90. def toSized[M[_]](implicit ts: ToSized[L, M]): Out

    Converts this HList to a - sized - M of elements typed as the least upper bound of the types of the elements of this HList.

  91. def toString(): String

    Definition Classes
    AnyRef → Any
  92. def transpose(implicit transpose: Transposer[L]): Out

    Transposes this HList.

  93. def tupled(implicit tupler: Tupler[L]): ops.hlist.Tupler.Out

    Converts this HList to a correspondingly typed tuple.

  94. def unify(implicit unifier: Unifier[L]): Out

    Returns an HList typed as a repetition of the least upper bound of the types of the elements of this HList.

  95. def unifySubtypes[B](implicit subtypeUnifier: SubtypeUnifier[L, B]): Out

    Returns an HList with all elements that are subtypes of B typed as B.

  96. def unzip(implicit unzipper: Unzip[L]): ops.hlist.Unzip.Out

    Unzips this HList of tuples returning a tuple of HLists.

    Unzips this HList of tuples returning a tuple of HLists. Available only if there is evidence that this HList has tuple elements.

  97. def updateWith[U, V, Out <: HList](f: (U) ⇒ V)(implicit replacer: Aux[L, U, V, (U, Out)]): Out

    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.

  98. def updatedAt[U, V, Out <: HList](n: Nat, u: U)(implicit replacer: Aux[L, N, U, (V, Out)]): Out

    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.

  99. def updatedAt[N <: Nat]: UpdatedAtAux[N]

    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.

  100. def updatedElem[U, Out <: HList](u: U)(implicit replacer: Aux[L, U, U, (U, Out)]): Out

    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.

  101. def updatedType[U]: UpdatedTypeAux[U]

    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.

  102. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  103. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  104. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  105. def zip(implicit zipper: Zip[L]): Out

    Zips this HList of HLists returning an HList of tuples.

    Zips this HList of HLists returning an HList of tuples. Available only if there is evidence that this HList has HList elements.

  106. def zip[R <: HList](r: R)(implicit zipper: Zip[::[L, ::[R, HNil]]]): Out

    Zips this HList with its argument HList returning an HList of pairs.

  107. def zipApply[A <: HList](a: A)(implicit zipper: ZipApply[L, A]): Out

    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.

  108. def zipConst[C](c: C)(implicit zipConst: ZipConst[C, L]): Out

    Zips this HList with a constant, resulting in an HList of tuples of the form ({element from this HList}, {supplied constant})

  109. def zipOne[T <: HList](t: T)(implicit zipOne: ZipOne[L, T]): Out

    Zips this HList with its argument HList of HLists, returning an HList of HLists with each element of this HList prepended to the corresponding HList element of the argument HList.

  110. def zipWith[R <: HList, P <: Poly2](r: R)(p: P)(implicit zipWith: ZipWith[L, R, P]): Out

    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.

  111. def zipWithKeys[K <: HList](implicit withKeys: ZipWithKeys[K, L]): Out

    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.

  112. def zipWithKeys[K <: HList](keys: K)(implicit withKeys: ZipWithKeys[K, L]): Out

    Converts this HList of values into a record with the provided keys.

Deprecated Value Members

  1. def unzipped(implicit unzipper: Unzip[L]): ops.hlist.Unzip.Out

    Unzips this HList of tuples returning a tuple of HLists.

    Unzips this HList of tuples returning a tuple of HLists. Available only if there is evidence that this HList has tuple elements.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use unzip instead

  2. def zipped(implicit zipper: Zip[L]): Out

    Zips this HList of HLists returning an HList of tuples.

    Zips this HList of HLists returning an HList of tuples. Available only if there is evidence that this HList has HList elements.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use zip instead

Inherited from AnyRef

Inherited from Any

Ungrouped