| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Category
Description
Local category hierarchy without object constraints.
Category is local so morphisms can carry an associated object
constraint. This version removes the constraint-family apparatus:
objects are unconstrained at the type level and legitimacy is an
audit concern rather than a discharge concern.
Operator convention
The tip of the operator points in the direction of data flow.
Synopsis
- class Category (arr :: k -> k -> Type) where
- (.>) :: forall {k} arr (a :: k) (b :: k) (c :: k). Category arr => arr a b -> arr b c -> arr a c
- (|>) :: a -> (a -> b) -> b
- (<|) :: (a -> b) -> a -> b
- newtype K (m :: k -> Type) a (b :: k) = K {
- runK :: a -> m b
- class Category arr => FunctionLike (arr :: Type -> Type -> Type) where
- function :: (a -> b) -> arr a b
- class Pointed a where
- point :: a
Documentation
class Category (arr :: k -> k -> Type) where Source #
A category without object constraints.
Ob arr a is gone; every object is mentionable. Lawfulness is
checked by the axioma oracles rather than by type-level discharge.
Methods
id :: forall (a :: k). arr a a Source #
Identity morphism.
(.) :: forall (b :: k) (c :: k) (a :: k). arr b c -> arr a b -> arr a c Source #
Composition (right-to-left).
Instances
| Category Morphism Source # | |
| Category Hyper Source # | |
| Category Process Source # | |
| Category Pullback Source # | |
| Category arr => Category (AlgCat arr :: Type -> Type -> Type) Source # | |
| Monad m => Category (K m :: Type -> Type -> Type) Source # | |
| Monad m => Category (HyperA (K m) :: Type -> Type -> Type) Source # | |
| Category arr => Category (Net w arr :: Type -> Type -> Type) Source # | The |
| Category arr => Category (SMC w arr :: Type -> Type -> Type) Source # | |
| Category arr => Category (Trace t arr :: Type -> Type -> Type) Source # | |
| Category (->) Source # | Unconstrained function category. |
| Category arr => Category (Dagger arr :: k -> k -> Type) Source # | |
| Category arr => Category (Free arr :: k -> k -> Type) Source # | |
| (Strength t arr, Pointed (Unit t), TensorSeed t) => Category (SomeBody t arr :: Type -> Type -> Type) Source # |
The carrier of the composite is the tensor of the two carriers, and the
stored seed is combined with |
| Strength t arr => Category (Circ t arr :: k -> k -> Type) Source # | The laws hold only up to invertible |
| Category arr => Category (Body t ch arr :: k3 -> k3 -> Type) Source # | |
(.>) :: forall {k} arr (a :: k) (b :: k) (c :: k). Category arr => arr a b -> arr b c -> arr a c Source #
Forward composition. f .> g = g . f
newtype K (m :: k -> Type) a (b :: k) Source #
Kleisli arrows of a monad, named locally.
Instances
| Monad m => Distributive (,) Either (K m :: Type -> Type -> Type) Source # | Distributivity of |
Defined in Circuit.Tensor Methods distl :: K m (a, Either b c) (Either (a, b) (a, c)) Source # distl' :: K m (Either (a, b) (a, c)) (a, Either b c) Source # distr :: K m (Either a b, c) (Either (a, c) (b, c)) Source # distr' :: K m (Either (a, c) (b, c)) (Either a b, c) Source # | |
| Monad m => Channel Either (K m :: Type -> Type -> Type) Source # | Cocartesian monoidal structure for |
| Monad m => Channel These (K m :: Type -> Type -> Type) Source # | Inclusive monoidal structure for |
| Monad m => Channel (,) (K m :: Type -> Type -> Type) Source # | Cartesian monoidal structure for |
| Monad m => Channel (,) (HyperA (K m) :: Type -> Type -> Type) Source # | |
| Monad m => Strength Either (K m :: Type -> Type -> Type) Source # | Traced for Iterates by feeding
This instance is |
| Monad m => Strength These (K m :: Type -> Type -> Type) Source # | Inclusive tensorial strength for |
| Monad m => Strength (,) (K m :: Type -> Type -> Type) Source # | Traced for The lazy knot is tied via
|
| Monad m => Strength (,) (HyperA (K m) :: Type -> Type -> Type) Source # | |
| Traced Either (K IO) Source # | Traced for Each iteration re-establishes the prompt boundary. When
|
| Monad m => Traced Either (K m :: Type -> Type -> Type) Source # | |
| MonadFix m => Traced (,) (K m :: Type -> Type -> Type) Source # | |
| MonadFix m => Traced (,) (HyperA (K m) :: Type -> Type -> Type) Source # | |
| Monad m => Par Either (K m :: Type -> Type -> Type) Source # | Coproduct as multiplicative disjunction on |
| Monad m => HasDual () (K m :: Type -> Type -> Type) Source # | Dualising object Same shape as the |
| Monad m => HasDual Bool (K m :: Type -> Type -> Type) Source # | Dualising object Same shape as the |
| Monad m => Action Either (K m :: Type -> Type -> Type) Source # | Coproduct symmetry on |
| Monad m => Action These (K m :: Type -> Type -> Type) Source # | Inclusive symmetry on |
| Monad m => Action (,) (K m :: Type -> Type -> Type) Source # | |
Defined in Circuit.Tensor | |
| Monad m => Tensor Either (K m :: Type -> Type -> Type) Source # | Coproduct tensor action on
|
| Monad m => Tensor These (K m :: Type -> Type -> Type) Source # | Inclusive tensor action on |
| Monad m => Tensor (,) (K m :: Type -> Type -> Type) Source # | Cartesian tensor on |
| Monad m => Unital Either (K m :: Type -> Type -> Type) Source # | Coproduct unit structure on |
| Monad m => Unital These (K m :: Type -> Type -> Type) Source # | Inclusive unit structure on |
| Monad m => Unital (,) (K m :: Type -> Type -> Type) Source # | Cartesian unit structure on |
| (Monad m, Pointed s) => HasDual Void (Body Either s (K m) :: Type -> Type -> Type) Source # | Unit poles for |
| Monad m => HasDual () (Body (,) s (K m) :: Type -> Type -> Type) Source # | Unit poles for Same shape as the |
| Monad m => Category (K m :: Type -> Type -> Type) Source # | |
| Monad m => Category (HyperA (K m) :: Type -> Type -> Type) Source # | |
| Monad m => Shared (,) (K m) Source # | Cartesian shared fusion on |
| Monad m => FunctionLike (K m) Source # | Kleisli arrows embed pure functions by returning the result in the monad. |
Defined in Circuit.Category | |
class Category arr => FunctionLike (arr :: Type -> Type -> Type) where Source #
Categories that can embed pure functions as morphisms.
This is the canonical functor from the function category (->) into
arr. It is useful for lifting decision procedures (e.g. bias in a
race) into arrows such as Kleisli categories.
Instances
| Monad m => FunctionLike (K m) Source # | Kleisli arrows embed pure functions by returning the result in the monad. |
Defined in Circuit.Category | |
| FunctionLike (->) Source # | Functions embed as themselves. |
Defined in Circuit.Category | |
class Pointed a where Source #
A pointed object: an object with a distinguished element.
This class has no laws by construction — it merely names a chosen
element. It is the structural requirement for the coproduct-unit poles
of 'Body Either': on a payload input the companion must produce a carrier
value, and there is no ambient state to use. Monoid is over-strong for
this purpose, since only the identity element is needed.
Instances
| Pointed () Source # | The singleton type is canonically pointed. |
Defined in Circuit.Category | |
| Pointed (Maybe a) Source # | |
Defined in Circuit.Category | |
| Pointed [a] Source # | Lists are canonically pointed at the empty list. |
Defined in Circuit.Category | |