After reading about Category Theory at https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ I was wondering whether we can represent any program by means of a walk of a graph induced by the category of types.
EDIT: rephrasing the question a little bit.
So, given the category of types where the objects belong to a set of types $V$ and the morphisms are a set of functions $F$ with $f : a \rightarrow b$, if we define a walk on this category as a sequence $v_0, e_{0,1}, v_1, ..., v_n$, with $v_i \in V$ and $e_{i,j} \in E \subset F$, with $E$ as the default set of functions of any given programming language (add, mul, <, etc.), the pure part of a program could be defined as a walk on this set $E$.
So, for example, a program to return the greatest of two integers could be represented as:
v0 -> e1 -> v1 -> e2 -> v2
(Int, Int) -> e1 -> (Bool, Int, Int) -> e2 -> Int
with:
e1 : (Int, Int) -> (Bool, Int, Int)
e1 x y = (x>y, x, y)
e2 : (Bool, Int, Int) -> (Int, Int)
e2 b x y = if b then x else y
given that e1 and e2 are part of the subset of morphisms.
So, is the definition of a walk and this set $E$ sufficient to represent the pure part of any program?