liftM

Promote a function to a monad. This is equivalent to fmap but specialised to Monads.
Promote a function to a monad.
Promote a bijection to a Control.Invertible.MonadArrow-form bijection. (Equivalent to bifmap and biarr.)
Promote a function to a monad.
The analysis monad consists of the following RWST components:
  • Env: Reader-like context. Contains a substitution, info about how how lifted identifiers are to be expanded into applications and configuration options.
  • OrdList FloatLang: Writer output for the resulting STG program.
  • No pure state component
  • But wrapping around UniqSM for generating fresh lifted binders. (The uniqAway approach could give the same name to two different lifted binders, so this is necessary.)
Promote a function to a monad, scanning the monadic arguments from left to right.

Examples

>>> liftM2 (+) [0,1] [0,2]
[0,2,1,3]
>>> liftM2 (+) (Just 1) Nothing
Nothing
>>> liftM2 (+) (+ 3) (* 2) 5
18
Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).
Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).
Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).
Promote a function to a monad, scanning the monadic arguments from left to right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3]
liftM2 (+) (Just 1) Nothing = Nothing
application of a vector function on the flattened matrix elements
application of a vector function on the flattened matrices elements
A version of liftMatrix2 which automatically adapt matrices with a single row or column to match the dimensions of the other matrix.
Lift a Maybe value into the Unpickler monad. The 1. arg is the attached error message
Lift a Process action.