Class

shapeless.syntax

CoproductOps

Related Doc: package syntax

Permalink

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

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. def adjoined(implicit adjoin: Adjoin[C]): ops.adjoin.Adjoin.Out

    Permalink

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

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

    Permalink

    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

    Permalink

    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

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

    Permalink

    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]

    Permalink

    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

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

    Permalink

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

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

    Permalink

    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

    Permalink

    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

    Permalink

    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]

    Permalink

    Extend this Coproduct on the left.

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

    Permalink

    Extend this Coproduct on the left.

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

    Permalink

    Extend this Coproduct on the right.

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

    Permalink

    Extend this Coproduct on the right.

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

    Permalink

    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]

    Permalink

    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

    Permalink

    Flatmaps a higher rank function across this Coproduct.

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

    Permalink

    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

    Permalink

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

  24. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  25. def head(implicit cc: IsCCons[C]): Option[H]

    Permalink

    Returns the head of this Coproduct

  26. def indexOf[A](implicit indexOf: IndexOf[C, A]): Nat

    Permalink

    Returns index of A in this 'Coproduct'

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

    Permalink

    Returns all elements except the last

  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def last(implicit il: InitLast[C]): Option[L]

    Permalink

    Returns the last element of this 'Coproduct'

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

    Permalink

    Compute the length of this Coproduct.

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

    Permalink

    Maps a higher rank function across this Coproduct.

  32. def partition[U](implicit partition: Partition[C, U]): Either[Prefix, Suffix]

    Permalink
  33. def partitionC[U](implicit partition: Partition[C, U]): :+:[Prefix, :+:[Suffix, CNil]]

    Permalink
  34. def removeElem[U](implicit remove: Remove[C, U]): Either[U, Rest]

    Permalink

    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 removeElemC[U](implicit remove: Remove[C, U]): :+:[U, Rest]

    Permalink

    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.

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

    Permalink

    Reverses this Coproduct.

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

    Permalink

    Rotate this 'Coproduct' left by n

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

    Permalink

    Rotate this 'Coproduct' left by N.

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

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

    Permalink

    Rotate this 'Coproduct' right by n

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

    Permalink

    Rotate this 'Coproduct' right by N.

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

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

  44. def splitC(n: Nat)(implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]

    Permalink
  45. def splitC[N <: Nat](implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]

    Permalink
  46. def tail(implicit cc: IsCCons[C]): Option[T]

    Permalink

    Returns the tail of this Coproduct

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    Embeds this Coproduct into an Either

  50. def toString(): String

    Permalink
    Definition Classes
    Any
  51. def unify(implicit unifier: Unifier[C]): ops.coproduct.Unifier.Out

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    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.

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

    Permalink

    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