HKDSumGeneric

trait HKDSumGeneric[A] extends HKDGeneric[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.

Companion:
object
trait HKDGeneric[A]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

class IdxWrapper[X](val idx: Index[X])

A wrapper for Index where we want wildcards of it.

A wrapper for Index where we want wildcards of it.

Inherited from:
HKDGeneric

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.

type NameOf[X <: ElemTop] <: Names

Returns the name of a field given the type of the field.

Returns the name of a field given the type of the field.

Inherited types

type FieldOf[Name <: Names] <: ElemTop

Returns the type of a field given its name.

Returns the type of a field given its name.

Inherited from:
HKDGeneric
type Gen[_[_]]

A representation of A supporting higher kinded types.

A representation of A supporting higher kinded types.

Inherited from:
HKDGeneric
type Index[A]

The index of the Gen type.

The index of the Gen type.

Inherited from:
HKDGeneric
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.

Inherited from:
HKDGeneric
type TupleRep <: Tuple

A tuple representation of A.

A tuple representation of A.

Inherited from:
HKDGeneric

The name of the A type.

The name of the A type.

Inherited from:
HKDGeneric

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.

Same as indexOfA but also essentially cats 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 cats the value to the unknown type, allowing further operations on it that requires that it is a subtype of A.

def indexToName[X <: ElemTop](idx: Index[X]): NameOf[X]

Given a index, return the name of the index.

Given a index, return the name of the index.

Concrete methods

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.

def indexOfA(a: A): IdxWrapper[_ <: ElemTop]

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

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

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.

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.

Inherited methods

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

Converts Gen to the tuple representation.

Converts Gen to the tuple representation.

Inherited from:
HKDGeneric
def nameToIndex[Name <: Names](name: Name): Index[FieldOf[Name]]

Returns the index of the field a name corresponds to.

Returns the index of the field a name corresponds to.

Inherited from:
HKDGeneric
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.

Inherited from:
HKDGeneric

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.

Inherited from:
HKDGeneric
def tupleToGen[F[_]](tuple: Map[TupleRep, F]): Gen[F]

Converts the tuple representation to Gen.

Converts the tuple representation to Gen.

Inherited from:
HKDGeneric

The name of the A type.

The name of the A type.

Inherited from:
HKDGeneric
inline def upcastIndex[X](idx: Index[X]): IdxWrapper[_ <: ElemTop]

Upcast an index to its bound.

Upcast an index to its bound.

Inherited from:
HKDGeneric

Inherited fields

lazy val representable: Aux[Gen, Index]
Inherited from:
HKDGeneric
lazy val traverse: TraverseKC[Gen]
Inherited from:
HKDGeneric

Givens

Inherited givens

Inherited from:
HKDGeneric
Inherited from:
HKDGeneric
Inherited from:
HKDGeneric
given given_TraverseKC_Gen: TraverseKC[Gen]
Inherited from:
HKDGeneric