free-agent
Safe HaskellNone
LanguageGHC2024

Free.Agent.Layer

Description

Layer instance for FreeAgent: unit run bind into any category.

Mirrors Free so free agent terms obey the same β/η laws as the circuits free-category layer.

Synopsis

Documentation

runFreeAgent :: Category arr => FreeAgent arr a b -> arr a b Source #

Fold a free agent term back into its base category.

bindFreeAgent :: forall arr' (arr :: Type -> Type -> Type) a b. Category arr' => (arr :~> arr') -> FreeAgent arr a b -> arr' a b Source #

Fold a free agent term into any target category.

Orphan instances

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

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 #