shapeless

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

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

  3. 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 apply[N <: Nat](n: N)(implicit at: At[L, N]): Out

    Returns the nth of this HList.

    Returns the nth of this HList. Available only if there is evidence that this HList has at least n elements.

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

    Returns the nth of this HList.

    Returns the nth of this HList. An explicit type argument must be provided. Available only if there is evidence that this HList has at least n elements.

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def drop[N <: Nat](n: N)(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()
  23. def flatMap[HF](f: HF)(implicit mapper: FlatMapper[HF, L]): Out

    Flatmaps a higher rank function across this HList.

  24. def foldLeft[R, HF](z: R)(op: HF)(implicit folder: LeftFolder[L, R, HF]): 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, HF](z: R)(f: HF)(op: (R, R) ⇒ R)(implicit folder: MapFolder[L, R, HF]): 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, HF](z: R)(op: HF)(implicit folder: RightFolder[L, R, HF]): 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]): 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[HF](f: HF)(implicit mapper: Mapper[HF, 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[HF](op: HF)(implicit reducer: LeftReducer[L, HF]): 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[HF](op: HF)(implicit reducer: RightReducer[L, HF]): 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[SL, L]): (SL, 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[U, L]): (U, 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]): (U, 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, return 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, return 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](n: N)(implicit split: ReverseSplit[L, N]): (P, S)

    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]): (P, S)

    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]): (P, S)

    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]): (P, S)

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

  52. def split[N <: Nat](n: N)(implicit split: Split[L, N]): (P, S)

    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.

  53. def split[N <: Nat](implicit split: Split[L, N]): (P, S)

    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.

  54. def splitLeft[U](implicit splitLeft: SplitLeft[L, U]): (P, S)

    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.

  55. def splitRight[U](implicit splitRight: SplitRight[L, U]): (P, S)

    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.

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

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

    Returns that tail of this HList.

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

  58. def take[N <: Nat](n: N)(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.

  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. An explicit type argument must be provided. Available only if there is evidence that this HList has at least n elements.

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

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

  62. def toString(): String

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

    Transposes this HList.

  64. def tupled(implicit tupler: Tupler[L]): Out

    Converts this HList to a correspondingly typed tuple.

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

  66. def unzipped(implicit unzipper: Unzip[L]): 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.

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

    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.

  68. def updatedElem[U](u: U)(implicit replacer: Replacer[L, U, U]): 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.

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

  70. final def wait(): Unit

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped