Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Support for access to a read only value of a particular type.
Synopsis
- data Reader (r :: Type) :: Effect
- runReader :: HasCallStack => r -> Eff (Reader r : es) a -> Eff es a
- withReader :: HasCallStack => (r1 -> r2) -> Eff (Reader r2 : es) a -> Eff (Reader r1 : es) a
- ask :: (HasCallStack, Reader r :> es) => Eff es r
- asks :: (HasCallStack, Reader r :> es) => (r -> a) -> Eff es a
- local :: (HasCallStack, Reader r :> es) => (r -> r) -> Eff es a -> Eff es a
Effect
data Reader (r :: Type) :: Effect Source #
Provide access to a strict (WHNF), thread local, read only value of type
r
.
Instances
type DispatchOf (Reader r) Source # | |
Defined in Effectful.Reader.Static | |
newtype StaticRep (Reader r) Source # | |
Defined in Effectful.Reader.Static |
Handlers
:: HasCallStack | |
=> r | The initial environment. |
-> Eff (Reader r : es) a | |
-> Eff es a |
Run a Reader
effect with the given initial environment.
:: HasCallStack | |
=> (r1 -> r2) | The function to modify the environment. |
-> Eff (Reader r2 : es) a | Computation to run in the modified environment. |
-> Eff (Reader r1 : es) a |
Execute a computation in a modified environment.
Since: 1.1.0.0
Operations
:: (HasCallStack, Reader r :> es) | |
=> (r -> a) | The function to apply to the environment. |
-> Eff es a |