This technique was beautifully re-invented
by Ben-Avi and Winter (2007) in their paper [A modular
approach to
->>>>>>> f879a647e289a67b992caaafd497910259a81040
intensionality](http://parles.upf.es/glif/pub/sub11/individual/bena_wint.pdf),
though without explicitly using monads.
-
All of the code in the discussion below can be found here: [[intensionality-monad.ml]].
To run it, download the file, start OCaml, and say