Yicho: A Combinator Library for Program TransformationContentsIndex
Yicho.ExpY
Portabilityportable
Stabilityexperimental
Maintaineryokoyama@ipl.t.u-tokyo.ac.jp
Contents
Manipulating the environment
name supply
Description
This module provides the functions to manipulate the expressions of type ExpY.
Synopsis
type HM e = ErrorT String Q e
type Y e = StateT ((String, Q [Dec]), Subst) (ErrorT String Q) e
type ExpY = Y ExpQ
type RuleY = ExpQ -> ExpY
runY :: Y (Q e) -> Q e
liftY :: Q a -> Y a
getSubstY :: Y Subst
getDecY :: Y (String, Q [Dec])
putDecY :: (String, Q [Dec]) -> Y ()
genNames :: Int -> HM [Name]
genvar :: String -> Q ExpQ
pvar :: String -> Y ExpQ
pvars :: [String] -> Y [ExpQ]
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