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].
- Alphabetic
- By Inheritance
- CoproductOps
- Serializable
- Serializable
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CoproductOps(c: C)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
adjoined(implicit adjoin: Adjoin[C]): ops.adjoin.Adjoin.Out
Adjoins the elements of this
Coproductby flattening anyCoproductelements. -
def
align[K <: Coproduct](k: K)(implicit align: Align[C, K]): K
Permutes this
Coproductinto the same order as anotherCoproduct.Permutes this
Coproductinto the same order as anotherCoproduct. Available only if bothCoproducts have elements of the same types. -
def
align[K <: Coproduct](implicit align: Align[C, K]): K
Permutes this
Coproductinto the same order as anotherCoproduct.Permutes this
Coproductinto the same order as anotherCoproduct. An explicit type argument must be supplied. Available only if bothCoproducts have elements of the same types. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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 thisCoproducthas at least n elements. -
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 thisCoproducthas at least n elements. - val c: C
-
def
deembed[Sub <: Coproduct](implicit basis: Basis[C, Sub]): Out
De-embeds a sub-
Coproductfrom thisCoproductif possible. -
def
drop(n: Nat)(implicit drop: Drop[C, N]): Out
Drops the first
nelements of thisCoproduct.Drops the first
nelements of thisCoproduct. Available only if there is evidence that thisCoproducthas at least n elements. -
def
drop[N <: Nat](implicit drop: Drop[C, N]): Out
Drops the first
nelements of thisCoproduct.Drops the first
nelements of thisCoproduct. An explicit type argument must be provided. Available only if there is evidence that thisCoproducthas at least n elements. -
def
embed[Super <: Coproduct](implicit basis: Basis[Super, C]): Super
Embeds this
Coproductinto a "bigger"Coproductif possible.Embeds this
Coproductinto a "bigger"Coproductif possible.For instance,
Int :+: String :+: CNilcan be embedded inInt :+: Bool :+: String :+: CNil. -
def
extendLeft[T]: :+:[T, C]
Extend this
Coproducton the left. -
def
extendLeftBy[K <: Coproduct](implicit extendLeftBy: ExtendLeftBy[K, C]): Out
Extend this
Coproducton the left. -
def
extendRight[T](implicit extendRight: ExtendRight[C, T]): Out
Extend this
Coproducton the right. -
def
extendRightBy[K <: Coproduct](implicit extendRightBy: ExtendRightBy[C, K]): Out
Extend this
Coproducton the right. -
def
filter[U](implicit partition: Partition[C, U]): Option[Prefix]
Returns all elements of type
Uof thisCoproduct.Returns all elements of type
Uof thisCoproduct. An explicit type argument must be provided. -
def
filterNot[U](implicit partition: Partition[C, U]): Option[Suffix]
Returns all elements of type different than
Uof thisCoproduct.Returns all elements of type different than
Uof thisCoproduct. An explicit type argument must be provided. -
def
flatMap(op: Poly)(implicit flatMap: FlatMap[C, op.type]): Out
Flatmaps a higher rank function across this
Coproduct. -
def
fold(f: Poly)(implicit folder: Folder[f.type, C]): ops.coproduct.Folder.Out
Computes a fold over this
Coproductusing the higher ranked functionf.Computes a fold over this
Coproductusing the higher ranked functionf. Available only if there is evidencefcan be applied all the elements of thisCoproduct. -
def
foldLeft[In](z: In)(op: Poly)(implicit folder: LeftFolder[C, In, op.type]): ops.coproduct.LeftFolder.Out
Computes a left fold over this
Coproductusing the polymorphic binary combining operatorop. -
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
def
head(implicit cc: IsCCons[C]): Option[H]
Returns the head of this
Coproduct -
def
init(implicit il: InitLast[C]): Option[I]
Returns all elements except the last
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last(implicit il: InitLast[C]): Option[L]
Returns the last element of this 'Coproduct'
-
def
length(implicit length: Length[C]): Out
Compute the length of this
Coproduct. -
def
map(f: Poly)(implicit mapper: Mapper[f.type, C]): Out
Maps a higher rank function across this
Coproduct. - def partition[U](implicit partition: Partition[C, U]): Either[Prefix, Suffix]
- def partitionC[U](implicit partition: Partition[C, U]): :+:[Prefix, :+:[Suffix, CNil]]
-
def
removeElem[U](implicit remove: Remove[C, U]): Either[U, Rest]
Returns the first element of type
Uof thisCoproductplus the remainder of theCoproduct.Returns the first element of type
Uof thisCoproductplus the remainder of theCoproduct. An explicit type argument must be provided. Available only if there is evidence that thisCoproducthas an element of typeU. -
def
removeElemC[U](implicit remove: Remove[C, U]): :+:[U, Rest]
Returns the first element of type
Uof thisCoproductplus the remainder of theCoproduct.Returns the first element of type
Uof thisCoproductplus the remainder of theCoproduct. An explicit type argument must be provided. Available only if there is evidence that thisCoproducthas an element of typeU. -
def
reverse(implicit reverse: Reverse[C]): Out
Reverses this
Coproduct. -
def
rotateLeft(n: Nat)(implicit rotateLeft: RotateLeft[C, N]): Out
Rotate this 'Coproduct' left by
n -
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.
-
def
rotateRight(n: Nat)(implicit rotateRight: RotateRight[C, N]): Out
Rotate this 'Coproduct' right by
n -
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.
-
def
select[T](implicit selector: Selector[C, T]): Option[T]
Returns the first element of type
Uof thisCoproduct.Returns the first element of type
Uof thisCoproduct. An explicit type argument must be provided. Available only if there is evidence that thisCoproducthas an element of typeU. -
def
split(n: Nat)(implicit split: Split[C, N]): Out
Splits this
Coproductat the nth element, returning the prefix and suffix as a pair.Splits this
Coproductat the nth element, returning the prefix and suffix as a pair. Available only if there is evidence that thisCoproducthas at least n elements. -
def
split[N <: Nat](implicit split: Split[C, N]): Out
Splits this
Coproductat the nth element, returning the prefix and suffix as a pair.Splits this
Coproductat 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 thisCoproducthas at least n elements. - def splitC(n: Nat)(implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]
- def splitC[N <: Nat](implicit split: Split[C, N]): :+:[Left, :+:[Right, CNil]]
-
def
tail(implicit cc: IsCCons[C]): Option[T]
Returns the tail of this
Coproduct -
def
take(n: Nat)(implicit take: Take[C, N]): Out
Takes the first
nelements of thisCoproduct.Takes the first
nelements of thisCoproduct. Available only if there is evidence that thisCoproducthas at least n elements. -
def
take[N <: Nat](implicit take: Take[C, N]): Out
Takes the first
nelements of thisCoproduct.Takes the first
nelements of thisCoproduct. An explicit type argument must be provided. Available only if there is evidence that thisCoproducthas at least n elements. -
def
toEither(implicit coproductToEither: CoproductToEither[C]): ops.coproduct.CoproductToEither.Out
Embeds this
Coproductinto anEither -
def
toString(): String
- Definition Classes
- Any
-
def
unify(implicit unifier: Unifier[C]): ops.coproduct.Unifier.Out
Returns the value of this
Coproduct, typed as the least upper bound of thisCoproductelements' types -
def
zipConst[Z](z: Z)(implicit zipConst: ZipConst[Z, C]): Out
Zips this
Coproductwith the given constant, resulting in aCoproductof tuples of the form ({element from thisCoproduct}, {supplied constant}) -
def
zipWith[H <: HList](h: H)(implicit zipWith: ZipWith[H, C]): Out
Zips this
Coproductwith the providedHList, resulting in aCoproductof tuples of the form ({element from thisCoproduct}, {element from inputHList}). -
def
zipWithIndex(implicit zipper: ZipWithIndex[C]): Out
Zips this
Coproductwith its element indices, resulting in aCoproductof tuples of the form ({element from input tuple}, {element index}) -
def
zipWithKeys[K <: HList](implicit zipWithKeys: ZipWithKeys[K, C]): Out
Converts this
Coproductof values into a union with given keys.Converts this
Coproductof values into a union with given keys. A type argument must be provided. -
def
zipWithKeys[K <: HList](keys: K)(implicit zipWithKeys: ZipWithKeys[K, C]): Out
Converts this
Coproductof values into a union with the provided keys.