Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
MSFs with a Reader monadic layer.
This module contains functions to work with MSFs that include a Reader
monadic layer. This includes functions to create new MSFs that include an
additional layer, and functions to flatten that layer out of the MSF's
transformer stack.
- module Control.Monad.Trans.Reader
- readerS :: Monad m => MSF m (s, a) b -> MSF (ReaderT s m) a b
- runReaderS :: Monad m => MSF (ReaderT s m) a b -> MSF m (s, a) b
- runReaderS_ :: Monad m => MSF (ReaderT s m) a b -> s -> MSF m a b
- readerS' :: Monad m => MSF m (s, a) b -> MSF (ReaderT s m) a b
- runReaderS' :: Monad m => MSF (ReaderT s m) a b -> MSF m (s, a) b
- runReaderS'' :: Monad m => MSF (ReaderT s m) a b -> MSF m (s, a) b
Documentation
module Control.Monad.Trans.Reader
Reader MSF wrapping/unwrapping.
readerS :: Monad m => MSF m (s, a) b -> MSF (ReaderT s m) a b Source #
Build an MSF in the Reader
monad from one that takes the reader
environment as an extra input. This is the opposite of runReaderS
.
runReaderS_ :: Monad m => MSF (ReaderT s m) a b -> s -> MSF m a b Source #
Build an MSF function that takes a fixed environment as additional
input, from an MSF in the Reader
monad.
This should be always equal to:
runReaderS_ msf s = arr (a -> (s,a)) >>> runReaderS msf
although possibly more efficient.
Alternative implementation using internal type.
readerS' :: Monad m => MSF m (s, a) b -> MSF (ReaderT s m) a b Source #
Alternative version of readerS
.
runReaderS' :: Monad m => MSF (ReaderT s m) a b -> MSF m (s, a) b Source #
Alternative version of runReaderS
wrapping/unwrapping functions.
Alternative implementation using generic lifting.
runReaderS'' :: Monad m => MSF (ReaderT s m) a b -> MSF m (s, a) b Source #
Alternative version of runReaderS
.