On 6 December 2011 05:06, Michael Snoyman <[email protected]> wrote:
> Maybe this will help[1]. It's using RWST instead of StateT, but it's
> the same idea.
>
> [1] 
> https://github.com/yesodweb/yesod/commit/7619e4e9dd88c152d1e00b6fea073c3d52dc797f#L0R105

Hi Michael,

Note that you can just reuse the MonadTransControl instance of the
RWST transformer:

instance MonadTransControl (GGWidget master) where
    newtype StT (GGWidget master) a =
        StWidget {unStWidget :: StT (GWInner master) a}
    liftWith f = GWidget $ liftWith $ \run ->
                   f $ liftM StWidget . run . unGWidget
    restoreT = GWidget . restoreT . liftM unStWidget

Cheers,

Bas

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to