Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This module provides a generic way to combine multiple MonadReader
contexts into a single one.
Example
{-# LANGUAGE TupleSections #-} f :: (MonadReader r m, Has A r, Has B r) => m () f = do (a :: A) <- ask (b :: B) <- ask doSomething a b main = let a = makeA :: A b = makeB :: B in flip runReaderT (a, ()) . withReaderT (b,) $ f