Yicho: A Combinator Library for Program TransformationContentsIndex
Yicho.Expressions
Portabilityportable
Stabilityexperimental
Maintaineryokoyama@ipl.t.u-tokyo.ac.jp
Contents
Patterns
Eta reduction
Closures
Expressions
Names
Pretty Printing
Description
This module provides the functions to manipulate the expressions of type Exp.
Synopsis
pat2names :: Pat -> [Name]
lamexpmatch :: Pat -> Exp -> Maybe [(Name, Exp)]
pat2exp :: Pat -> Exp
exp2pat :: Exp -> Pat
patfield2exp :: FieldPat -> FieldExp
data CL = CL {
expC :: Exp
boundsC :: [Name]
frozensC :: [Name]
}
flexC :: CL -> Bool
rigidC :: CL -> Bool
isFreeC :: CL -> Bool
unboundlocalsC :: CL -> [Name]
freevarsC :: CL -> [Name]
flex :: Exp -> [Name] -> Bool
headargs :: Exp -> (Exp, [Exp])
subexps :: Exp -> [Exp]
eqBox :: (Exp, [Name]) -> (Exp, [Name]) -> [Name] -> Bool
secondOrder :: Exp -> Bool
flat :: [Name] -> Exp -> Bool
linear :: [Name] -> Exp -> Bool
simplifyLam :: Exp -> Exp
outmostlocalvars :: Exp -> [Name]
getBody :: Exp -> Exp
splitTup :: Exp -> ([Exp], [Name] -> Pat)
isLambda :: Exp -> Bool
lambdaBody :: Exp -> Exp
appearsin :: Exp -> Bool
isGlobalN :: Name -> Bool
isLocal :: Name -> Bool
isBoundLocal :: Name -> [Name] -> Bool
isUnboundLocal :: Name -> [Name] -> Bool
isOperator :: Exp -> Bool
mkOperator :: Exp -> Exp
unboundlocals :: Exp -> [Name]
freevars :: Exp -> [Name]
freevarsDec :: Dec -> [Name]
freevarsClause :: Clause -> [Name]
freevarsBody :: Body -> [Name]
decname :: Dec -> [Name]
constrname :: Dec -> [Name]
Patterns
pat2names :: Pat -> [Name]
Return free variables in Pat
Eta reduction
lamexpmatch :: Pat -> Exp -> Maybe [(Name, Exp)]
pat2exp :: Pat -> Exp
Converting Pat to Exp
exp2pat :: Exp -> Pat
patfield2exp :: FieldPat -> FieldExp
Closures
data CL
Closures
Constructors
CL
expC :: Expexpression
boundsC :: [Name]names of bound variables
frozensC :: [Name]names of frozen variables
show/hide Instances
flexC :: CL -> Bool
rigidC :: CL -> Bool
isFreeC :: CL -> Bool
unboundlocalsC :: CL -> [Name]
freevarsC :: CL -> [Name]
Expressions
flex :: Exp -> [Name] -> Bool
Whether the given expression is flexible
headargs :: Exp -> (Exp, [Exp])
Split an expression into the head and its arguments
subexps :: Exp -> [Exp]
eqBox :: (Exp, [Name]) -> (Exp, [Name]) -> [Name] -> Bool
secondOrder :: Exp -> Bool
we regard types of constans as small as possible. for example, [| foldr (+) [] |] is second-order.
flat :: [Name] -> Exp -> Bool
linear :: [Name] -> Exp -> Bool
The domain should be flat, scond pattern
simplifyLam :: Exp -> Exp
get rid of LamE []
outmostlocalvars :: Exp -> [Name]
getBody :: Exp -> Exp
splitTup :: Exp -> ([Exp], [Name] -> Pat)
isLambda :: Exp -> Bool
lambdaBody :: Exp -> Exp
appearsin :: Exp -> Bool
check whether outmost formal parameters are appeared in the body of the lambda abstraction
Names
isGlobalN :: Name -> Bool
isLocal :: Name -> Bool
isBoundLocal :: Name -> [Name] -> Bool
isUnboundLocal :: Name -> [Name] -> Bool
isOperator :: Exp -> Bool
mkOperator :: Exp -> Exp
unboundlocals :: Exp -> [Name]
freevars :: Exp -> [Name]
freevarsDec :: Dec -> [Name]
freevarsClause :: Clause -> [Name]
freevarsBody :: Body -> [Name]
decname :: Dec -> [Name]
constrname :: Dec -> [Name]
Pretty Printing
Produced by Haddock version 0.6