4
$\begingroup$

If standard function composition is defined as:

 (define compose
   { (B → C) → (A → B) 
             → (A → C) }

   F G -> (λ X (F (G X))))

What type of composition does the below function describe? Is there a particular name for it in category theory?

 (define compose-2
   { (A → (X → C)) → (B → X)
                   → (A → B → C) }

   F G -> (λ Y (compose (F Y) G)))

composition diagram

$\endgroup$
2
$\begingroup$

You composition is of type $\operatorname{comp}:(A \to X \to C)\to (B \to X) \to (A\to B \to C)$. Up to Currying, it can be seen as being of type $(A \times X \to C)\to (B \to X) \to (A\times B \to C)$. So it's just a composition of a two arguments functions with a one argument function. You take $f$ and $g$ and return $(a,b)\mapsto f(a,g(b))$.

From a general abstract nonsense point of view, you can define the functor $$A\times -:\begin{array}{lll} O & \mapsto &A\times O\\ g : B \to X&\mapsto &<\operatorname{id}_A;g>:A\times B \to A\times X \end{array}$$ and then your composition is just $\operatorname{comp}=f\mapsto g \mapsto f\circ (A\times g)$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.