> "Cont (Endo b) a" is the usual backtracking monad.

It is?  Would you say more about that?  A pointer would be fine.  I'm wondering what the role of Endo is here.

Cheers,  - Conal

On 9/9/07, David Menendez <zednenem@psualum.com> wrote:
On 9/8/07, Conal Elliott <conal@conal.net> wrote:
> I'd like to see the following addition to Control.Monad.Cont in mtl:
>
> instance Monoid r => Monoid (Cont r a) where
>     mempty         = Cont mempty
>     m `mappend` m' = Cont (runCont m `mappend` runCont m')

Alternatively,

    instance Monoid r => MonadPlus (Cont r a) where
        mzero = Cont mempty
        mplus a b = Cont $ runCont a `mappend` runCont b

"Cont (Endo b) a" is the usual backtracking monad.