mongoDB-0.8.1: A driver for MongoDB

Control.Monad.Context

Description

This is just like Control.Monad.Reader.Class except you can access the context of any Reader in the monad stack instead of just the top one as long as the context types are different. If two or more readers in the stack have the same context type you get the context of the top one.

Synopsis

Documentation

class Monad m => Context x m whereSource

Same as MonadReader but without functional dependency so the same monad can have multiple contexts with different types

Methods

context :: m xSource

Get the context in the Reader in the monad stack that has x context type. Analogous to ask.

push :: (x -> x) -> m a -> m aSource

Push new context in the Reader in the monad stack that has x context type. Analogous to local

Instances

Monad m => Context Pipe (Action m) 
Monad m => Context MasterOrSlaveOk (Action m) 
Monad m => Context WriteMode (Action m) 
(Context x m, Error e) => Context x (ErrorT e m) 
Context x m => Context x (ReaderT r m) 
Monad m => Context x (ReaderT x m)