arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Job.Kind

Description

A payload's variant label, stored on the job row for filtering and grouping.

Synopsis

Documentation

class HasKind payload whereSource #

A payload's per-job variant label. With no instance, the job is unlabelled. An empty instance on a Generic payload labels it with the constructor name.

Minimal complete definition

Nothing

Methods

kindOf :: payload -> Maybe TextSource #

The label stored for a job.

default kindOf :: (GKind (Rep payload), Generic payload) => payload -> Maybe TextSource #

kindsFor :: [Text]Source #

Every label kindOf can return. Empty when the set is not known.

default kindsFor :: GKind (Rep payload) => [Text]Source #

Instances

Instances details
HasKind payload Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

kindOf :: payload -> Maybe TextSource #

kindsFor :: [Text]Source #

constructorKind :: (GKind (Rep a), Generic a) => a -> TextSource #

A value's constructor name, for a payload that wraps a sum. Requires Generic.

instance HasKind Envelope where
  kindOf = Just . constructorKind . envelopePayload
  kindsFor = constructorKinds @EmailPayload

constructorKinds :: GKind (Rep a) => [Text]Source #

Every constructor name of a type, in declaration order.

class GKind (f :: k -> Type) whereSource #

Constructor names of a generic representation, in declaration order.

Methods

gKindOf :: forall (a :: k). f a -> TextSource #

The constructor name of a value.

gKindsOf :: [Text]Source #

Every constructor name.

Instances

Instances details
GKind (V1 :: k -> Type) Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

gKindOf :: forall (a :: k). V1 a -> TextSource #

gKindsOf :: [Text]Source #

(GKind f, GKind g) => GKind (f :+: g :: k -> Type) Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

gKindOf :: forall (a :: k). (f :+: g) a -> TextSource #

gKindsOf :: [Text]Source #

KnownSymbol n => GKind (C1 ('MetaCons n fx s) f :: k -> Type) Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

gKindOf :: forall (a :: k). C1 ('MetaCons n fx s) f a -> TextSource #

gKindsOf :: [Text]Source #

GKind f => GKind (D1 d f :: k -> Type) Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

gKindOf :: forall (a :: k). D1 d f a -> TextSource #

gKindsOf :: [Text]Source #