Lift computations from the bottom of a Haskell monad transformer stack
open sourceBSD-3-Clausefree
transformers-base provides the MonadBase type class for Haskell's transformers library, a port of monadLib's BaseM: liftBase runs a computation from the base monad at the bottom of a transformer stack (such as IO or ST) from anywhere in the stack, however many layers deep. Libraries such as monad-control build on it. It's by Mikhail Vorozhtsov and Bas van Dijk, and is tested with GHC from 7.0 to 9.12.
Problems it solves
- lift an IO action through several monad transformer layers in Haskell
- write Haskell code that works in any monad stack with IO at the bottom
- call a function from the base monad inside a ReaderT or StateT stack without chaining lift
Features
- MonadBase type class with liftBase for the bottom of a transformer stack
- Instances for the transformers library's monad transformers
- Tested with GHC 7.0 through 9.12
