| Yicho: A Combinator Library for Program Transformation | Contents | Index |
|
Yicho.Expressions | Portability | portable | Stability | experimental | Maintainer | yokoyama@ipl.t.u-tokyo.ac.jp |
|
|
|
|
|
Description |
This module provides the functions to manipulate the expressions of type
Exp.
|
|
Synopsis |
|
|
|
|
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 :: Exp | expression
| boundsC :: [Name] | names of bound variables
| frozensC :: [Name] | names of frozen variables
|
|
| 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 |