Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Reader r :: Effect where
- runReader :: forall label r es a. HasCallStack => r -> Eff (Labeled label (Reader r) : es) a -> Eff es a
- ask :: forall label r es. (HasCallStack, Labeled label (Reader r) :> es) => Eff es r
- asks :: forall label r es a. (HasCallStack, Labeled label (Reader r) :> es) => (r -> a) -> Eff es a
- local :: forall label r es a. (HasCallStack, Labeled label (Reader r) :> es) => (r -> r) -> Eff es a -> Eff es a
Effect
data Reader r :: Effect where Source #
Instances
type DispatchOf (Reader r) Source # | |
Defined in Effectful.Reader.Dynamic |
Handlers
:: forall label r es a. HasCallStack | |
=> r | The initial environment. |
-> Eff (Labeled label (Reader r) : es) a | |
-> Eff es a |
Run the Reader
effect with the given initial environment (via
Effectful.Reader.Static).
Operations
ask :: forall label r es. (HasCallStack, Labeled label (Reader r) :> es) => Eff es r Source #
Fetch the value of the environment.
:: forall label r es a. (HasCallStack, Labeled label (Reader r) :> es) | |
=> (r -> a) | The function to apply to the environment. |
-> Eff es a |