simple-effects-0.9.0.1: A simple effect system that integrates with MTL

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Reader

Description

The regular old MonadReader effect with some differences. First, there's no functional dependency limiting your stack to a single environment type. This means less type inference so it might not be enough to just write readEnv. Write 'readEnv @MyEnvType' instead using TypeApplications.

Second, the function has a less generic name and is called readEnv.

Third, since it's a part of this effect framework, you get a handleReadEnv function with which you can provide a different environment implementation _at runtime_.

Documentation

data ReadEnv e Source #

Constructors

ReadEnv 

Instances

readEnv :: forall e m. MonadEffect (ReadEnv e) m => m e Source #

handleReadEnv :: Functor m => m e -> EffectHandler (ReadEnv e) m a -> m a Source #

handleSubreader :: MonadEffect (ReadEnv e) m => (e -> e') -> EffectHandler (ReadEnv e') m a -> m a Source #