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

Source #class HasKind payload where

A payload's per-job variant label. Defaults to unlabelled.

Minimal complete definition

Nothing

Methods

Source #kindOf :: payload -> Maybe Text

The label stored for a job.

Source #default kindOf :: (GKindOf (Rep payload), Generic payload) => payload -> Maybe Text

Source #kindsFor :: [Text]

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

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

Instances

Instances details
HasKind payload Source # 
Instance details

Defined in Arbiter.Core.Job.Kind

Methods

Source #kindOf :: payload -> Maybe Text

Source #kindsFor :: [Text]

Source #constructorKind :: (GKindOf (Rep a), Generic a) => a -> Text

The constructor name of a value, for a payload that wraps the sum it wants labelled. Needs Generic on the wrapped type.

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

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

Every constructor name of a type, in declaration order.

Source #class GKindOf (f :: k -> Type) where

The constructor name of a generic value.

Methods

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

Instances

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

Defined in Arbiter.Core.Job.Kind

Methods

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

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

Defined in Arbiter.Core.Job.Kind

Methods

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

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

Defined in Arbiter.Core.Job.Kind

Methods

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

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

Defined in Arbiter.Core.Job.Kind

Methods

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

Source #class GKindsOf (f :: k) where

Every constructor name of a generic representation, in declaration order.

Methods

Source #gKindsOf :: [Text]

Instances

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

Defined in Arbiter.Core.Job.Kind

Methods

Source #gKindsOf :: [Text]

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

Defined in Arbiter.Core.Job.Kind

Methods

Source #gKindsOf :: [Text]

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

Defined in Arbiter.Core.Job.Kind

Methods

Source #gKindsOf :: [Text]

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

Defined in Arbiter.Core.Job.Kind

Methods

Source #gKindsOf :: [Text]