Field

sealed abstract class Field[F[_], S, A]

Represents a member of product type (case class)

Companion:
object
class Object
trait Matchable
class Any

Type members

Types

type T

Value members

Abstract methods

def fold[B](folder: Folder[F, S, B]): B

Fold a field into a value independant of the type indexed by the field.

Fold a field into a value independant of the type indexed by the field.

def foldK[G[_]](folder: FolderK[F, S, G]): G[A]

Fold a field into a value tied to the type indexed by the field.

Fold a field into a value tied to the type indexed by the field.

def foreachT(s: S)(f: T => Unit): Unit

Applies a side-effecting thunk on the field's value, unpacking the option in case of an optional field.

Applies a side-effecting thunk on the field's value, unpacking the option in case of an optional field.

def get: S => A
def instance: F[T]
def instanceA(onOptional: ToOptional[F]): F[A]

Grabs the instance associated to this field, applying a polymorphic function when the field is optional

Grabs the instance associated to this field, applying a polymorphic function when the field is optional

def leftFolder[B](folder: LeftFolder[F, B]): (B, S) => B

Transforms the field into a function that can be applied on the product type, depending on whether it contains the corresponding value.

Transforms the field into a function that can be applied on the product type, depending on whether it contains the corresponding value.

def mapK[G[_]](f: PolyFunction[F, G]): Field[G, S, A]

Concrete methods

final def foreachA(s: S)(f: A => Unit): Unit

Applies a side-effecting thunk on the field's value, which will be an option in case of an optional field.

Applies a side-effecting thunk on the field's value, which will be an option in case of an optional field.