I am programmer (from the object oriented world) and currently getting my head around functional programming. I was looking to get some basics right.
I understand what category theory and lambda calculus try and tell . I did read that lambda calculus can be modelled in any Cartesian closed category. and this is the how the 2 ideas can combine. But this is where i lost my way.
1) What is a Cartesian closed category ? (dint understand the mathematical semantics given , so wanted to know in simple English with some examples if possible). 2) How can Lambda calculus express this Cartesian closed category?
In imperative programming there is a tendency to distinguish between
dataandmethods, whereas in functional programming, for example, they are identical. A closed category is a category that makes this identification: hom-sets (methods) correspond to certain objects (data). More concretely, the category is closed if it has a binary operation on objects $(X,Y) \mapsto Y^X$ such that it is actually the data version of methods: $$∀ X, Y, Z \;\;•\;\; (Z ⊕ X ⟶ Y) ≅ (Z ⟶ Y ^ X) \;\text{ natural in } Z, Y$$The Cartesian part says that we can form any finite
record---in the programming sense. That is, if we have $n$ records of interest $R_1, \ldots, R_n$ then we can amalgamate them into one record $\Pi_{i \in 1..n} R_i$ and that this is their product means that any function/method to it is precisely $n$ methods to the individual factors! $$ \forall X \;\bullet\; (X \to \Pi_{i \in 1..n} R_i) \cong \Pi_{i \in 1..n} (X \to R_i) $$ The left-hand $\Pi$ is the object in the category, while the right-hand $\Pi$ is the usual set-theoretic. The case $n = 0$ gives us the empty-tuple aka the terminal object. With this and the ability to construct a product of two records, we can construct all finite products ---this is the usual presentation of cartesian.Defining
type := object, these together say that:if a,b are types then (a -> b), a x b, and 1 are all types, which are the usual type-constructions expected when working in type theory.Hope this help :-)