 | Yicho: A Combinator Library for Program Transformation | Contents | Index |
|
| Yicho.ExpY | | Portability | portable | | Stability | experimental | | Maintainer | yokoyama@ipl.t.u-tokyo.ac.jp |
|
|
|
|
|
| Description |
| This module provides the functions to manipulate the expressions of type
ExpY.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| type HM e = ErrorT String Q e |
|
| type Y e = StateT ((String, Q [Dec]), Subst) (ErrorT String Q) e |
| Y monad
|
|
| type ExpY = Y ExpQ |
| an expression with the environment and failuire manipulation
|
|
| type RuleY = ExpQ -> ExpY |
| rule
|
|
| runY :: Y (Q e) -> Q e |
| ExpY -> ExpQ : the inverse of liftY
|
|
| liftY :: Q a -> Y a |
| ExpQ -> ExpY : the inverse of runY
|
|
| Manipulating the environment
|
|
| getSubstY :: Y Subst |
|
| getDecY :: Y (String, Q [Dec]) |
|
| putDecY :: (String, Q [Dec]) -> Y () |
|
| name supply
|
|
| genNames :: Int -> HM [Name] |
|
| genvar :: String -> Q ExpQ |
|
| pvar :: String -> Y ExpQ |
Generating a pattern variable
The following code changes the names each time it is called.
pvar = return . join . genvar . ($:)
|
|
| pvars :: [String] -> Y [ExpQ] |
| Generating pattern variables
|
|
| Produced by Haddock version 0.6 |