Moves ReaderIORef to a separate module to avoid circular imports
Defines ReadState/ReadStatePure combinators to derive HasReader from HasState.
Note, local requires to modify the state. Care needs to be taken to ensure that local is correct in the context of exceptions. ReadState uses MonadMask to that end. ReadStatePure can be used in cases where MonadMask is not available and exceptions cannot be caught in the monad.
ReaderIORef
to a separate module to avoid circular importsReadState
/ReadStatePure
combinators to deriveHasReader
fromHasState
.local
requires to modify the state. Care needs to be taken to ensure thatlocal
is correct in the context of exceptions.ReadState
usesMonadMask
to that end.ReadStatePure
can be used in cases whereMonadMask
is not available and exceptions cannot be caught in the monad.