proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Tools.SMC.Internal.Closed

Description

Internal module of Proarrow.Tools.SMC: functions and traces. It exports everything, also what the public module keeps hidden.

Synopsis

Documentation

lam :: forall {k} (d :: Nat) (r :: Ctx k) (a :: SYN k) (b :: SYN k) t cont. (Closed k, Binds ((~>) :: CAT k) d r a b t cont) => (t -> cont) -> Term d r (a ':-> b) Source Github #

A function: the body receives the argument through a pattern (see Patterns). This needs the category to be closed.

loop :: forall {k} {p :: k +-> k} (u :: SYN k) (b :: SYN k) (d :: Nat) (r :: Ctx k) t cont. (Costrong (Tensor :: k -> (k, k) -> Type) p, SymMonoidal k, KnownObj b, Binds p d r u (b ':** u) t cont) => (t -> cont) -> TermP p d r b Source Github #

Trace: the body receives the value fed back through a pattern (see Patterns), and returns it again next to the result. This needs the category to be traced.

class Apply (p :: CAT k) f x r | f -> p where Source Github #

Function application. A variable both the function and its argument use is copied. Explicit exponentials determine their result syntax. Embedded function objects, such as results of (-<), take their result syntax from the surrounding term.

Methods

(!) :: f -> x -> r infixl 8 Source Github #

Instances

Instances details
(KnownObj a, KnownObj b, Merge g1 g2, ToTerm p x d g2 a, r ~ TermP p d (Union g1 g2) b) => Apply (p :: CAT k) (TermP p d g1 (a ':-> b)) x r Source Github # 
Instance details

Defined in Proarrow.Tools.SMC.Internal.Closed

Methods

(!) :: TermP p d g1 (a ':-> b) -> x -> r Source Github #

(KnownObj a, KnownObj b, Merge g1 g2, f ~ (Interp a ~~> Interp b), ToTerm p x d g2 a, r ~ TermP p d (Union g1 g2) b) => Apply (p :: CAT k) (TermP p d g1 ('F f)) x r Source Github # 
Instance details

Defined in Proarrow.Tools.SMC.Internal.Closed

Methods

(!) :: TermP p d g1 ('F f) -> x -> r Source Github #

applyTerm :: forall {k} (a :: SYN k) (b :: SYN k) (p :: k +-> k) (d :: Nat) (g1 :: Ctx k) (g2 :: Ctx k) (f :: SYN k) x. (Closed k, MonoidalProfunctor p, KnownObj a, KnownObj b, Merge g1 g2, Interp f ~ (Interp a ~~> Interp b), ToTerm p x d g2 a) => TermP p d g1 f -> x -> TermP p d (Union g1 g2) b Source Github #