Arrows
There are two “metaphysically” important universal notions being visualized as arrows (which implies a certain direction).
\[\cdot\rightarrow\cdot\] A single “cons” or a single “relation”, or a single “step” (of a process determined by the causality Principle)
\[\cdot\rightarrow\cdot\rightarrow\cdot\] A “path” or a “thread” or a “list” or a “composition” or a “linear” structure
A path is “more than one” (another universal notion) steps.
Pattern
This pastern arises in:
- in a structure or RNA and a single strands of DNA (they are asymmetric or “directed”)
- in a structure of an immutable single linked list (box-and-pointer diagrams)
- in currying of multi-argument functions (named after Haskell Curry)
- in composition of pure curried functions (at a type-level)
- Continuation Passing Style (or CPS for short) where a continuation is a function (an arrow)
- in patches of acyclic graphs (a universal generalized notion)
- in so-called linear logic (an extension of a first-order logic)
- etc.
Nesting
Notice that a single-linked list is nesting of “conses” (pairs), while a composition of a functions is nesting of lambdas.
Threading
As long as your composition of functions (steps) is “threaded” (as beads on a rosary) it is “isolated” and “distinct” from all other values (or molecules).
We thus retain referential transparency and purity - nothing (literally) could intefere or disrupt a linear structure or a linear process.
This is a universal principle on which biology builds upon. It is not a coincidence that these patterns of linearity are literally everywhere.
There are a couple of ways to ensure “threading”
- explicit or implicit passing of a value or a context
- having the same unique tag attached to each computation (step)
FP
Linearity (and nesting ) in structures, processes and even in Logic arises from the underlying nature, not from some abstract bullshitting.
The notion than function composition could be only implemented via nesting (in Natural Order languages) is very deep and universal.
The serialization aspect of Monads is not arbitrary.
A Monad
has two distinct, orthogonal aspects:
- a generalization of an abstraction barrier (it is implemented an ADT after all)
- an implicit serialization or “threading” via nesting inside
(>>=)
or(>=>)
which even symbols being used are suggesting.
By the way,
m >>= f = (id >=> f) m