encoding of Rúnar's "Reasonably priced monads"