Does anyone know of work which talks about the relationship between programmatic functions and functions in calculus? Specifically, I'm curious about function composition and the pipe, `%>%`

operator. I'm a bush league mathematician, but it strikes me that perhaps that's something to do with the fact that I think pipes are easy, but nested functions are hard.

So, this:

h(x) = (f \circ g)(x) = f(g(x))

is equivalent to this:

```
h <- function(x) {
f(g(x))
}
```

is equivalent to this:

```
x %>%
g() %>%
h()
```

There is (so far as I'm aware) no mathematical operator equivalent to the pipe, but I see no reason why there couldn't be. If there were, how would it be used to describe things like the chain rule for differentiation?

Anyhoo. Curious what's out there.