Hi David,
I believe the easiest way to do what you want is to use MonadReader
class instead of explicit t (Reader [String] a)
:
push' :: MonadReader [String] m => String -> m a -> m a
push' s = local (s:)
Best,
Nick
I can write a stack push function in the reader monad like so:import Control.Monad.Readerpush :: String -> Reader [String] a -> Reader [String] apush s action = local (s :) actionHow can I write a push that works inside a monad transformer?push' :: MonadTrans t => String -> t (Reader [String]) a -> t (Reader [String]) apush' s action = ???
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe