hoopl

How can I combine the CheckingFuelMonad with a State monad in Hoopl?

故事扮演 提交于 2019-12-10 13:00:00
问题 I am using the Hoopl library and would like to carry some state around while rewriting. The rewrite functions are polymorphic regarding the monad used, but I cannot figure out how to combine a State monad with one of the library's Fuel monads. Below is a minimal example. MyMonad is a synonym combining Hoopl's CheckingFuelMonad and a State monad carrying a flag. Stmt is just a placeholder for my intermediate language and isn't really important. {-# LANGUAGE GADTs, RankNTypes #-} import