I have been looking at (and trying to understand) indexed monads recently. I think I have got my head around one style of indexed monad, as described here: A Neighbourhood of Infinity: Beyond Monads.
However, I have found a different style of indexed monad in index-core, which has some parts that seem to correspond to this indexed monad bind with two indexes, for example a similar bind operator !>=. While it clearly has similar changes to the indexes, I can't quite understand how to use these indexes, for example, to control the return types in a continuation monad as with the other style. I would be interested in this style of indexed monad, primarily because it seems to work a lot better for monad transformers - in fact I have not seen an indexed monad transformer (of indexed monads) defined in the other style, only an indexed transformer of regular monads.
I am wondering if anyone could please provide an example of the two result type continuation monad implemented as this style of continuation monad, or point me to other examples of the use of this module to define other indexed monads that make use of two indexes (for instance, the form of the state monad where the type of the state may change). I have been searching for such an example, without much luck, and I haven't managed to successfully implement it myself. I have a feeling it should be obvious, but I've got a bit tied up in the different constructors.