free-agent
Safe HaskellNone
LanguageGHC2024

Free.Agent.Syntax

Description

Free category over a base arrow, named for the agent seat.

Same shape as Free: Lift embeds a base arrow, Compose sequences free morphisms. Package role ABOVE circuits-agent — reify seats and pipelines here, then fold into Agent or Shard.

Synopsis

Documentation

data FreeAgent (arr :: k -> k -> Type) (a :: k) (b :: k) where Source #

Free category over a base arrow arr.

Constructors

Lift :: forall {k} (arr :: k -> k -> Type) (a :: k) (b :: k). arr a b -> FreeAgent arr a b

Embed a base arrow as a single generator.

Compose :: forall {k} (arr :: k -> k -> Type) (b1 :: k) (b :: k) (a :: k). FreeAgent arr b1 b -> FreeAgent arr a b1 -> FreeAgent arr a b

Sequence two free morphisms (right-to-left, matching Category composition).

Instances

Instances details
Category arr => Category (FreeAgent arr :: k -> k -> Type) Source # 
Instance details

Defined in Free.Agent.Syntax

Methods

id :: forall (a :: k). FreeAgent arr a a #

(.) :: forall (b :: k) (c :: k) (a :: k). FreeAgent arr b c -> FreeAgent arr a b -> FreeAgent arr a c #

Layer (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) Source #

FreeAgent is a free category, so it is a Layer over any base arrow. runFreeAgent and bindFreeAgent are the two folds.

Instance details

Defined in Free.Agent.Layer

Associated Types

type Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr' 
Instance details

Defined in Free.Agent.Layer

type Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr' = Category arr'
type Run (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr 
Instance details

Defined in Free.Agent.Layer

type Run (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr = Category arr
type Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr 
Instance details

Defined in Free.Agent.Layer

type Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr = ()

Methods

unit :: forall (arr :: Type -> Type -> Type). Category arr => arr :~> FreeAgent arr #

run :: (Run (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr, Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr, Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr) => FreeAgent arr a b -> arr a b #

bind :: forall arr' (arr :: Cat2) a b. (Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr', Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr) => (arr :~> arr') -> FreeAgent arr a b -> arr' a b #

type Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr Source # 
Instance details

Defined in Free.Agent.Layer

type Bind (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr = ()
type Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr' Source # 
Instance details

Defined in Free.Agent.Layer

type Law (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr' = Category arr'
type Run (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr Source # 
Instance details

Defined in Free.Agent.Layer

type Run (FreeAgent :: (Type -> Type -> Type) -> Type -> Type -> Type) arr = Category arr