-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Template Haskell library for writing monadic expressions more easily -- -- See README at the bottom. -- -- Getting started: See Each. @package each @version 0.1.0.0 -- | Names that are used to bind things in each blocks are defined -- here. module Each.Invoke -- | Do not use this outside of an each block. Only its name is used, and -- its value itself does not make sense. bind :: () -- | Do not use this outside of an each block. Only its name is used, and -- its value itself does not make sense. (~!) :: () -- | An internal module where most of the real transformation goes on. module Each.Transform transform :: Exp -> Env -> Q Result data Env Env :: Maybe TypeQ -> Env [envType] :: Env -> Maybe TypeQ data Result -- | This subexpression does not invoke bind, i.e. is pure Pure :: ExpQ -> Result -- | This subexpression contains invocations of bind Bind :: ExpQ -> Result -- | The basic structure of an each block is this: -- --
--   $(each [| ... |])
--   
-- -- Inside of this block, three (interchangable) ways are used to mark -- impure subexpressions: -- -- -- -- When each encounters such a subexpression, appropriate calls to -- fmap, <*> and join are generated so that -- the results generally match what you would expect. In particular, The -- impure actions are evaluated from left to right, so that: -- --
--   $(each [| bind getLine ++ bind getLine ])
--   
-- -- means -- --
--   (++) `fmap` getLine <*> getLine
--   
-- --

Type signatures

-- -- Type signatures like (x :: t), when used on expressions -- containing bind, i.e. impure subexpressions, are transformed in -- one of the following ways: -- -- module Each -- | Invoke an each block. Intended to be used as -- --
--   $(each [| ... |])
--   
each :: ExpQ -> ExpQ -- | Invoke an each block while specifying the context type, so that -- type annotations may be processed appropriately. -- --
--   $(eachWith [t| IO |] [| "Hello, " ++ (bind getLine :: String) |])
--   
-- -- means -- --
--   ("Hello, " ++) `fmap` (getLine :: IO String)
--   
-- -- using the IO type which is supplied to eachWith. eachWith :: TypeQ -> ExpQ -> ExpQ -- | Do not use this outside of an each block. Only its name is used, and -- its value itself does not make sense. bind :: () -- | Do not use this outside of an each block. Only its name is used, and -- its value itself does not make sense. (~!) :: ()