This looks similar to Jane Street's Incremental library for OCaml. It has the same structure of a nice library for doing incremental computation of outputs triggered by changes to the inputs by composing computations.
https://blogs.janestreet.com/introducing-incremental/