HKDSumGeneric

perspective.derivation.HKDSumGeneric
See theHKDSumGeneric companion object
trait HKDSumGeneric[A] extends HKDGeneric[A], GenHKDSumGeneric[A]

A type somewhat like Mirror.SumOf allowing manipulating a sum type as if it was defined as a higher kinded type.

Type parameters

A

The type being abstracted over.

Attributes

Companion
object
Source
hkdGeneric.scala
Graph
Supertypes
trait GenHKDSumGeneric[A]
trait HKDGeneric[A]
trait GenHKDGeneric[A]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

type Cat[B] = Option[B]

Attributes

Source
hkdGeneric.scala

Inherited types

override type ElemTop <: A

The top type for the inner type of Index and Gen.

The top type for the inner type of Index and Gen.

Attributes

Inherited from:
GenHKDSumGeneric
Source
hkdGeneric.scala
type Gen[_[_]]

A representation of A supporting higher kinded types.

A representation of A supporting higher kinded types.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
type IdxWrapper[X] = IdxWrapper[Index, X]

A wrapper for Index where we want wildcards of it.

A wrapper for Index where we want wildcards of it.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
type Index[B]

The index of the Gen type.

The index of the Gen type.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
type Names <: String

The name of the fields of A type. Field in this case can mean either the children of a sum type, or the fields of a product type.

The name of the fields of A type. Field in this case can mean either the children of a sum type, or the fields of a product type.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
type TupleRep <: Tuple

A tuple representation of A.

A tuple representation of A.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
type TypeName <: String

The name of the A type.

The name of the A type.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Value members

Abstract methods

def indexOf[X <: ElemTop](x: X): Index[X]

Returns the index of a value. Because of soundness, this method can not be used if X = A. In that case, use indexOfA instead.

Returns the index of a value. Because of soundness, this method can not be used if X = A. In that case, use indexOfA instead.

Attributes

Source
hkdGeneric.scala

Same as indexOfA but also essentially casts the value to the unknown type, allowing further operations on it that requires that it is a subtype of A.

Same as indexOfA but also essentially casts the value to the unknown type, allowing further operations on it that requires that it is a subtype of A.

Attributes

Source
hkdGeneric.scala

Concrete methods

def catFrom(a: Gen[Option]): Option[A]

Convert a value of the higher kinded representation to Cat[A].

Convert a value of the higher kinded representation to Cat[A].

Attributes

Source
hkdGeneric.scala
override def catTo(ao: Option[A]): Gen[Option]

Convert a value of Cat[A] to the higher kinded representation.

Convert a value of Cat[A] to the higher kinded representation.

Attributes

Definition Classes
Source
hkdGeneric.scala
def from(a: Gen[Option]): Option[A]

Convert a value of the higher kinded representation to A. Will only return Some if only one of the fields is Some and the rest is None.

Convert a value of the higher kinded representation to A. Will only return Some if only one of the fields is Some and the rest is None.

Attributes

Source
hkdGeneric.scala
def indexOfA(a: A): IdxWrapper[Index, _ <: ElemTop]

Same as indexOf but also works for values of type A.

Same as indexOf but also works for values of type A.

Attributes

Source
hkdGeneric.scala
def to(a: A): Gen[Option]

Convert a value of A to the higher kinded representation. It will be Some in only one field, corresponding to the subtype passed in, and None in all the others.

Convert a value of A to the higher kinded representation. It will be Some in only one field, corresponding to the subtype passed in, and None in all the others.

Attributes

Source
hkdGeneric.scala
inline def widenConst[F[_]](gen: Gen[F]): Gen[Const[F[A]]]

Widen the higher kinded representation to a Const type of the top type.

Widen the higher kinded representation to a Const type of the top type.

Attributes

Source
hkdGeneric.scala

Inherited methods

def genToScalaTuple[F[_]](gen: Gen[F]): Map[TupleRep, F]

Converts Gen to the scala tuple representation.

Converts Gen to the scala tuple representation.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def genToTuple[F[_]](gen: Gen[F]): TupleMap[TupleRep, F]

Converts Gen to the tuple representation.

Converts Gen to the tuple representation.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def indexToName[X](idx: Index[X]): Names

Given a index, return the name of the index.

Given a index, return the name of the index.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Returns the index of the field a name corresponds to.

Returns the index of the field a name corresponds to.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def names: Gen[Const[Names]]

The name of the fields of A type. Field in this case can mean either the children of a sum type, or the fields of a product type.

The name of the fields of A type. Field in this case can mean either the children of a sum type, or the fields of a product type.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def scalaTupleToGen[F[_]](tuple: Map[TupleRep, F]): Gen[F]

Converts the scala tuple representation to Gen.

Converts the scala tuple representation to Gen.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Validates a string as a name if it matches the name of a field.

Validates a string as a name if it matches the name of a field.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def tabulateFoldLeft[B](start: B)(f: B => [X] => (x$1: Index[X]) => B): B

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def tabulateTraverseK[G[_], B[_]](f: [X] => (x$1: Index[X]) => G[B[X]])(using Applicative[G]): G[Gen[B]]

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def tabulateTraverseKEither[E, B[_]](f: [X] => (x$1: Index[X]) => Either[E, B[X]]): Either[E, Gen[B]]

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def tabulateTraverseKOption[B[_]](f: [X] => (x$1: Index[X]) => Option[B[X]]): Option[Gen[B]]

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
def tupleToGen[F[_]](tuple: TupleMap[TupleRep, F]): Gen[F]

Converts the tuple representation to Gen.

Converts the tuple representation to Gen.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

The name of the A type.

The name of the A type.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
inline def upcastIndex[X](idx: Index[X]): IdxWrapper[Index, _ <: ElemTop]

Upcast an index to its bound.

Upcast an index to its bound.

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Inherited fields

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Givens

Inherited givens

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
given given_Conversion_IdxWrapper_Index[X]: Conversion[IdxWrapper[X], Index[X]]

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
given given_Conversion_Index_IdxWrapper[X]: Conversion[Index[X], IdxWrapper[X]]

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala

Extensions

Extensions

extension (ao: Option[A])
def productElementCat[X](index: Index[X]): Option[X]

Attributes

Source
hkdGeneric.scala

Exports

Inherited defined exports

final type ReprWrapper = this.representable.ReprWrapper
Exported from BoundedRepresentableK

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
final type RepresentationK = this.representable.RepresentationK
Exported from RepresentableK

Attributes

Inherited from:
GenHKDGeneric
Source
hkdGeneric.scala
val boundedRepresentableK: BoundedEnumerable[BoundedRepresentableK.this.ReprWrapper[_]]
Exported from BoundedRepresentableK

Attributes

Inherited from:
GenHKDGeneric
Source
BoundedRepresentableK.scala
def indicesK[C]: RepresentableK.this.F[RepresentableK.this.RepresentationK, C]
Exported from RepresentableK

Access the indices or the representation of this type.

Access the indices or the representation of this type.

Attributes

Inherited from:
GenHKDGeneric
Source
RepresentableK.scala
def tabulateConst[A, C](f: RepresentableK.this.RepresentationK :~>#: A): RepresentableK.this.F[Const[A], C]
Exported from RepresentableK

Helper function that calls tabulateK with Const.

Helper function that calls tabulateK with Const.

Attributes

Inherited from:
GenHKDGeneric
Source
RepresentableK.scala
def tabulateK[A[_], C](f: FunctionK[RepresentableK.this.RepresentationK, A]): RepresentableK.this.F[A, C]
Exported from RepresentableK

A higher kinded equivalent of cats.Representable.tabulate.

A higher kinded equivalent of cats.Representable.tabulate.

Attributes

Inherited from:
GenHKDGeneric
Source
RepresentableK.scala
def unitK[C]: ApplicativeK.this.F[Const[Unit], C]
Exported from ApplicativeK

A higher kinded equivalent of cats.Applicative.unit.

A higher kinded equivalent of cats.Applicative.unit.

Attributes

Inherited from:
GenHKDGeneric
Source
ApplicativeK.scala