reader

module Control.Monad.Reader
mtl Control.Monad.Reader
* Computation type: Computations which read values from a shared environment. * Binding strategy: Monad values are functions from the environment to a value. The bound function is applied to the bound value, and both have access to the shared environment. * Useful for: Maintaining variable bindings, or other shared environment. * Zero and plus: None. * Example type: Reader [(String,Value)] a The Reader monad (also called the Environment monad). Represents a computation, which can read values from a shared environment, pass values from function to function, and execute sub-computations in a modified environment. Using Reader monad for such computations is often clearer and easier than using the State monad. Inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://web.cecs.pdx.edu/~mpj/) Advanced School of Functional Programming, 1995.
module Control.Monad.Trans.Reader
transformers Control.Monad.Trans.Reader
Declaration of the ReaderT monad transformer, which adds a static environment to a given monad. If the computation is to modify the stored information, use Control.Monad.Trans.State instead.
type Reader a = Text -> Either String (a, Text)
text Data.Text.Lazy.Read, text Data.Text.Read
Read some text. If the read succeeds, return its value and the remaining text, otherwise an error message.
type Reader r = ReaderT r Identity
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
The parameterizable reader monad. Computations are functions of a shared environment. The return function ignores the environment, while >>= passes the inherited environment to both subcomputations.
reader :: (Monoid w, Monad m) => (r -> a) -> RWST r w s m a
transformers Control.Monad.Trans.RWS.Lazy, transformers Control.Monad.Trans.RWS.Strict
Constructor for computations in the reader monad (equivalent to asks).
reader :: Monad m => (r -> a) -> ReaderT r m a
transformers Control.Monad.Trans.Reader
Constructor for computations in the reader monad (equivalent to asks).
reader :: MonadReader r m => (r -> a) -> m a
mtl Control.Monad.Reader.Class, mtl Control.Monad.Reader
ReaderT :: (r -> m a) -> ReaderT r a
mtl Control.Monad.Reader
ReaderT :: (r -> m a) -> ReaderT r m a
transformers Control.Monad.Trans.Reader
newtype ReaderT r m a
transformers Control.Monad.Trans.Reader
The reader monad transformer, which adds a read-only environment to the given monad. The return function ignores the environment, while >>= passes the inherited environment to both subcomputations.
package manatee-reader
package
manatee-reader is feed reader extension for Manatee (Haskell/Gtk+ Integrated Live Environment) Default configuration template at Config/Reader.hs, copy to directory `HOME.manateeconfig/`. Note, you need re-install package to start the configuration file take effect the next time, Video (Select 720p HD) at : http://www.youtube.com/watch?v=weS6zys3U8k http://www.youtube.com/watch?v=A3DgKDVkyeM http://v.youku.com/v_show/id_XMjI2MDMzODI4.html Screenshots at : http://goo.gl/MkVw Manual at : http://haskell.org/haskellwiki/Manatee IRC channel: irc.freenode.net 6667 ##manatee Mailing-List: manatee-user@googlegroups.com manatee-develop@googlegroups.com Version 0.1.1
mapReader :: (a -> b) -> Reader r a -> Reader r b
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
Transform the value returned by a Reader. *  (mapReader f m) = f . > runReader
mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
Transform the computation inside a ReaderT. *  (mapReaderT f m) = f . > runReaderT
class Monad m => MonadReader r m | m -> r
mtl Control.Monad.Reader.Class, mtl Control.Monad.Reader
See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.
runReader :: Reader r a -> r -> a
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
Runs a Reader and extracts the final value from it. (The inverse of reader.)
runReaderT :: ReaderT r a -> r -> m a
mtl Control.Monad.Reader
The underlying computation, as a function of the environment.
runReaderT :: ReaderT r m a -> r -> m a
transformers Control.Monad.Trans.Reader
The underlying computation, as a function of the environment.
withReader :: (r' -> r) -> Reader r a -> Reader r' a
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
Execute a computation in a modified environment (a specialization of withReaderT). *  (withReader f m) = runReader m > .
withReaderT :: (r' -> r) -> ReaderT r m a -> ReaderT r' m a
transformers Control.Monad.Trans.Reader, mtl Control.Monad.Reader
Execute a computation in a modified environment (a more general version of local). *  (withReaderT f m) = > runReaderT m .