# BM Category Theory 8 : Function objects (Exponentials), Curry / unCurry

8.1

[Revision] Product (or Sum = co-Product) is a Bifunctor

• takes 2 objects to produce 3rd object;
• takes 2 morphisms to produce 3rd morphism.

Functions are “morphisms between Category objects”  = a Hom-Set, which itself is an object : ‘a -> b’.

Using the same method of Universal Construction of Product objects in category :

1. Define a Pattern ,
2. Ranking which object is better,
3. Pick the best object up to an UNIQUE Isomorphism.

we can similarly construct the Function Objects ‘a => b‘ (in Haskell as ‘a -> b’) :

Intuitively, the above diagram is interpreted as:

• evalthe Function object(a=>b) x ato return result b
• g is up to Unique isomorphism (hSAME as ‘eval: $\boxed {g = eval \circ (h \text { x } id )}$

Curry / Non-curry : Associative (yellow brackets below are optional).

$\boxed {z \to (a \to b ) \iff z \to a \to b }$

$\boxed { (f a ) \: b \iff f a \: b }$

Note: function (f a) returns as a new  function which applies on argument b. Equivalently, also read as “f takes 2 arguments a, b”.

Example:

f :: Bool -> Int

Bool = {0, 1}
${ f = (Int \text { x } Int) = Int^{2} = Int ^ {Bool}}$

The number of possibilities of applying f from a to b is $\boxed {b^{a}}$, hence we call:
$\boxed {\text {Function object f as EXPONENTIAL}}$

8.2  Algebraic Data Types