{- |
These functions work in arbitrary monads
but are especially helpful when working with the CodeGenFunction monad.
-}moduleLLVM.Extra.MonadwhereimportControl.Monad(liftM2,liftM3,join,(<=<),)chain::(Monadm)=>[a->ma]->(a->ma)chain=foldr(flip(<=<))returnliftR2::(Monadm)=>(a->b->mc)->ma->mb->mcliftR2fmamb=join(liftM2fmamb)liftR3::(Monadm)=>(a->b->c->md)->ma->mb->mc->mdliftR3fmambmc=join(liftM3fmambmc)