Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
class Monad m =>
MonadReader r (m :: Type -> Type) | m -> rcan-i-haz Control.Monad.Reader.Has See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.
mapReader :: (a -> b) -> Reader r a -> Reader r bcan-i-haz Control.Monad.Reader.Has Transform the value returned by a Reader.
mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n bcan-i-haz Control.Monad.Reader.Has Transform the computation inside a ReaderT.
runReaderT (mapReaderT f m) = f . runReaderT m
runReader :: Reader r a -> r -> acan-i-haz Control.Monad.Reader.Has Runs a Reader and extracts the final value from it. (The inverse of reader.)
runReaderT :: ReaderT r (m :: Type -> Type) a -> r -> m acan-i-haz Control.Monad.Reader.Has No documentation available.
withReader :: (r' -> r) -> Reader r a -> Reader r' acan-i-haz Control.Monad.Reader.Has Execute a computation in a modified environment (a specialization of withReaderT).
runReader (withReader f m) = runReader m . f
withReaderT :: forall r' r (m :: Type -> Type) a . (r' -> r) -> ReaderT r m a -> ReaderT r' m acan-i-haz Control.Monad.Reader.Has Execute a computation in a modified environment (a more general version of local).
runReaderT (withReaderT f m) = runReaderT m . f
class (Monad m, HasSource tag r m) =>
HasReader (tag :: k) r (m :: Type -> Type) | tag m -> rcapability Capability.Reader Reader capability An instance should fulfill the following laws. At this point these laws are not definitive, see https://github.com/haskell/mtl/issues/5.
k <*> ask @t = ask @t <**> k
ask @t *> m = m = m <* ask @t
local @t f (ask @t) = fmap f (ask @t)
local @t f . local @t g = local @t (g . f)
local @t f (pure x) = pure x
local @t f (m >>= \x -> k x) = local @t f m >>= \x -> local @t f (k x)
reader @t f = f <$> ask @t
type
HasReader' (tag :: k) = HasReader tag TypeOf k tagcapability Capability.Reader Type synonym using the TypeOf type family to specify HasReader constraints without having to specify the type associated to a tag.
newtype
MonadReader (m :: Type -> Type) acapability Capability.Reader Derive HasSource from m's MonadReader instance.