How would you implement the reverse state monad transformer in OCaml?
This is a follow-up of the question The reverse state monad in OCaml: I was able to rediscover @Lambdageek's answer by myself after understanding the tricks he or she used (especially the pattern matching of lazy expressions in the module LazyUtils). Then I spent the rest of the day trying to generalize this to the case of the reverse state transformer. But I am stuck because I cannot find how to define the bind. The only solution that I can vaguely imagine would use the mfix of the monad in parameter but this is itself problematic to define because it leads to looping recursion due to the strict semantics in OCaml.