c

shapeless.syntax

CoproductOps

final class CoproductOps[C <: Coproduct] extends AnyVal with Serializable

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

Linear Supertypes
Serializable, Serializable, AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CoproductOps
  2. Serializable
  3. Serializable
  4. AnyVal
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CoproductOps(c: C)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def adjoined(implicit adjoin: Adjoin[C]): ops.adjoin.Adjoin.Out

    Adjoins the elements of this Coproduct by flattening any Coproduct elements.

  5. def align[K <: Coproduct](k: K)(implicit align: Align[C, K]): K

    Permutes this Coproduct into the same order as another Coproduct.

    Permutes this Coproduct into the same order as another Coproduct. Available only if both Coproducts have elements of the same types.

  6. def align[K <: Coproduct](implicit align: Align[C, K]): K

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

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def at(n: Nat)(implicit at: At[C, N]): Option[A]

    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.

  9. def at[N <: Nat](implicit at: At[C, N]): Option[A]

    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.

  10. val c: C
  11. def deembed[Sub <: Coproduct](implicit basis: Basis[C, Sub]): Out

    De-embeds a sub-Coproduct from this Coproduct if possible.

  12. def drop(n: Nat)(implicit drop: Drop[C, N]): Out

    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.

  13. def drop[N <: Nat](implicit drop: Drop[C, N]): Out

    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.

  14. def embed[Super <: Coproduct](implicit basis: Basis[Super, C]): Super

    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.

  15. def extendLeft[T]: :+:[T, C]

    Extend this Coproduct on the left.

  16. def extendLeftBy[K <: Coproduct](implicit extendLeftBy: ExtendLeftBy[K, C]): Out

    Extend this Coproduct on the left.

  17. def extendRight[T](implicit extendRight: ExtendRight[C, T]): Out

    Extend this Coproduct on the right.

  18. def extendRightBy[K <: Coproduct](implicit extendRightBy: ExtendRightBy[C, K]): Out

    Extend this Coproduct on the right.

  19. def filter[U](implicit partition: Partition[C, U]): Option[Prefix]

    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.

  20. def filterNot[U](implicit partition: Partition[C, U]): Option[Suffix]

    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.

  21. def flatMap(op: Poly)(implicit flatMap: FlatMap[C, op.type]): Out

    Flatmaps a higher rank function across this Coproduct.

  22. def fold(f: Poly)(implicit folder: Folder[f.type, C]): ops.coproduct.Folder.Out

    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.

  23. def foldLeft[In](z: In)(op: Poly)(implicit folder: LeftFolder[C, In, op.type]): ops.coproduct.LeftFolder.Out

    Computes a left fold over this Coproduct using the polymorphic binary combining operator op.

  24. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  25. def head(implicit cc: IsCCons[C]): Option[H]

    Returns the head of this Coproduct

  26. def init(implicit il: InitLast[C]): Option[I]

    Returns all elements except the last

  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def last(implicit il: InitLast[C]): Option[L]

    Returns the last element of this 'Coproduct'

  29. def length(implicit length: Length[C]): Out

    Compute the length of this Coproduct.

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

    Maps a higher rank function across this Coproduct.

  31. def partition[U](implicit partition: Partition[C, U]): Either[Prefix, Suffix]
  32. def partitionC[U](implicit partition: Partition[C, U]): :+:[Prefix, :+:[Suffix, CNil]]
  33. def removeElem[U](implicit remove: Remove[C, U]): Either[U, Rest]

    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.

  34. def removeElemC[U](implicit remove: Remove[C, U]): :+:[U, Rest]

    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.

  35. def reverse(implicit reverse: Reverse[C]): Out

    Reverses this Coproduct.

  36. def rotateLeft(n: Nat)(implicit rotateLeft: RotateLeft[C, N]): Out

    Rotate this 'Coproduct' left by n

  37. def rotateLeft[N <: Nat](implicit rotateLeft: RotateLeft[C, N]): Out

    Rotate this 'Coproduct' left by N.

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

  38. def rotateRight(n: Nat)(implicit rotateRight: RotateRight[C, N]): Out

    Rotate this 'Coproduct' right by n

  39. def rotateRight[N <: Nat](implicit rotateRight: RotateRight[C, N]): Out

    Rotate this 'Coproduct' right by N.

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

  40. def select[T](implicit selector: Selector[C, T]): Option[T]

    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.

  41. def split(n: Nat)(implicit split: Split[C, N]): Out

    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.

  42. def split[N <: Nat](implicit split: Split[C, N]): Out

    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.

  43. def splitC(n: Nat)(implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]
  44. def splitC[N <: Nat](implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]
  45. def tail(implicit cc: IsCCons[C]): Option[T]

    Returns the tail of this Coproduct

  46. def take(n: Nat)(implicit take: Take[C, N]): Out

    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.

  47. def take[N <: Nat](implicit take: Take[C, N]): Out

    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.

  48. def toEither(implicit coproductToEither: CoproductToEither[C]): ops.coproduct.CoproductToEither.Out

    Embeds this Coproduct into an Either

  49. def toString(): String
    Definition Classes
    Any
  50. def unify(implicit unifier: Unifier[C]): ops.coproduct.Unifier.Out

    Returns the value of this Coproduct, typed as the least upper bound of this Coproduct elements' types

  51. def zipConst[Z](z: Z)(implicit zipConst: ZipConst[Z, C]): Out

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

  52. def zipWith[H <: HList](h: H)(implicit zipWith: ZipWith[H, C]): Out

    Zips this Coproduct with the provided HList, resulting in a Coproduct of tuples of the form ({element from this Coproduct}, {element from input HList}).

  53. def zipWithIndex(implicit zipper: ZipWithIndex[C]): Out

    Zips this Coproduct with its element indices, resulting in a Coproduct of tuples of the form ({element from input tuple}, {element index})

  54. def zipWithKeys[K <: HList](implicit zipWithKeys: ZipWithKeys[K, C]): Out

    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.

  55. def zipWithKeys[K <: HList](keys: K)(implicit zipWithKeys: ZipWithKeys[K, C]): Out

    Converts this Coproduct of values into a union with the provided keys.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyVal

Inherited from Any

Ungrouped