shapeless.syntax

HListOps

Related Doc: package syntax

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 ReplaceTypeAux[U] extends AnyRef

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

  3. class UpdatedTypeAux[U] extends AnyRef

Value Members

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

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Append the argument HList to this HList.

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

    Prepend the argument HList to this HList.

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

    Prepend the argument element to this HList.

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

    Append the argument element to this HList.

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

    Prepend the argument element to this HList.

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

    Prepend the argument HList to this HList.

  9. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. 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.

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

  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. 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.

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

  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. 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.

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

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

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

    Definition Classes
    AnyRef → Any
  20. def filter[U](implicit filter: Filter[L, U]): Out

    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.

  21. def filterNot[U](implicit filter: FilterNot[L, U]): Out

    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.

  22. def finalize(): Unit

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

    Flatmaps a higher rank function across this HList.

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

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

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

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

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

    Definition Classes
    AnyRef → Any
  29. 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.

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

  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. 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.

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

    Compute the length of this HList.

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

    Maps a higher rank function across this HList.

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

    Replaces each element of this HList with a constant value.

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

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

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

    Definition Classes
    AnyRef
  39. 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.

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

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

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

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

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

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

    Reverses this HList.

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

    Prepend the reverse of the argument HList to this HList.

  47. def reverse_split(n: Nat)(implicit split: ReverseSplit[L, N]): ops.hlist.ReverseSplit.Out

    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.

  48. def reverse_split[N <: Nat](implicit split: ReverseSplit[L, N]): ops.hlist.ReverseSplit.Out

    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.

  49. def reverse_splitLeft[U](implicit splitLeft: ReverseSplitLeft[L, U]): ops.hlist.ReverseSplitLeft.Out

    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.

  50. def reverse_splitRight[U](implicit splitRight: ReverseSplitRight[L, U]): ops.hlist.ReverseSplitRight.Out

    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.

  51. def runtimeLength: Int

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

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

  53. def split(n: Nat)(implicit split: Split[L, N]): ops.hlist.Split.Out

    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.

  54. def split[N <: Nat](implicit split: Split[L, N]): ops.hlist.Split.Out

    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.

  55. def splitLeft[U](implicit splitLeft: SplitLeft[L, U]): ops.hlist.SplitLeft.Out

    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.

  56. def splitRight[U](implicit splitRight: SplitRight[L, U]): ops.hlist.SplitRight.Out

    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.

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

    Definition Classes
    AnyRef
  58. 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.

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

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

  61. def toArray[Lub](implicit toArray: ToArray[L, Lub]): Array[Lub]

    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.

  62. def toList[Lub](implicit toList: ToList[L, Lub]): List[Lub]

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

  63. def toString(): String

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

    Transposes this HList.

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

    Converts this HList to a correspondingly typed tuple.

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

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

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

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

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

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

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

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

  73. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. 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.

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

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

  79. 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})

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

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

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