mongoDB-0.7: 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