
I mean m, not M.
On Thu, Oct 31, 2013 at 3:54 PM, David Fox
Hmm, I'm still having trouble implementing local for the MonadReader instance of M.
On Thu, Oct 31, 2013 at 11:59 AM, Nickolay Kudasov < nickolay.kudasov@gmail.com> wrote:
Hi David,
I believe the easiest way to do what you want is to use MonadReaderclass instead of explicit t (Reader [String] a):
push' :: MonadReader [String] m => String -> m a -> m apush' s = local (s:)
Best, Nick
2013/10/31 David Fox
I can write a stack push function in the reader monad like so:
import Control.Monad.Reader
push :: String -> Reader [String] a -> Reader [String] a push s action = local (s :) action
How can I write a push that works inside a monad transformer?
push' :: MonadTrans t => String -> t (Reader [String]) a -> t (Reader [String]) a push' s action = ???
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe