lift package:HaTeX

Lift a computation from the argument monad to the constructed monad.
Lift a inner function of LaTeX values into any LaTeXC instance.
Variant of liftL with a two arguments function.
Variant of liftL with a three arguments function.
Variant of liftL with a four arguments function.
Variant of liftL with a five arguments function.
Variant of liftL with a six arguments function.
Variant of liftL with a seven arguments function.
Variant of liftL with an eight arguments function.
Variant of liftL with a nine arguments function.
This method must take a function that combines a list of LaTeX values into a new one, and creates a function that combines l-typed values. The combining function can be seen as a function with 0 or more LaTeX arguments with a LaTeX value as output.
Lift a function over LaTeX values to a function acting over the state of a LaTeXT computation.
Lift a computation from the IO monad. This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations (i.e. IO is the base monad for the stack).

Example

import Control.Monad.Trans.State -- from the "transformers" library

printState :: Show s => StateT s IO ()
printState = do
state <- get
liftIO $ print state
Had we omitted liftIO, we would have ended up with this error:
• Couldn't match type ‘IO’ with ‘StateT s IO’
Expected type: StateT s IO ()
Actual type: IO ()
The important part here is the mismatch between StateT s IO () and IO (). Luckily, we know of a function that takes an IO a and returns an (m a): liftIO, enabling us to run the program and see the expected results:
> evalStateT printState "hello"
"hello"

> evalStateT printState 3
3
Lift an operator over LaTeX values to an operator acting over the state of two LaTeXT computations. Note: The returned value is the one returned by the second argument of the lifted operator.