This library provides selector functions, test and update operations
as well as some useful auxiliary functions for FlatCurry data terms.
Most of the provided functions are based on general transformation
functions that replace constructors with user-defined
functions. For recursive datatypes the transformations are defined
inductively over the term structure. This is quite usual for
transformations on FlatCurry terms,
so the provided functions can be used to implement specific transformations
without having to explicitly state the recursion. Essentially, the tedious
part of such transformations - descend in fairly complex term structures -
is abstracted away, which hopefully makes the code more clear and brief.
Author: Sebastian Fischer
Version: January 2006
| Exported names: |
Datatypes:
Update
Functions:
allVars
| allVarsInFunc
| allVarsInProg
| allVarsInRule
| argTypes
| branchExpr
| branchPattern
| caseBranches
| caseExpr
| caseType
| combArgs
| combName
| combType
| consArgs
| consArity
| consName
| consVisibility
| domain
| freeExpr
| freeVars
| funcArgs
| funcArity
| funcBody
| funcName
| funcRHS
| funcRule
| funcType
| funcVisibility
| isCase
| isComb
| isCombTypeConsCall
| isCombTypeConsPartCall
| isCombTypeFuncCall
| isCombTypeFuncPartCall
| isConsCall
| isConsPartCall
| isConsPattern
| isExternal
| isFree
| isFuncCall
| isFuncPartCall
| isFuncType
| isGround
| isLet
| isLit
| isOr
| isRuleExternal
| isTCons
| isTVar
| isTypeSyn
| isVar
| letBinds
| letBody
| literal
| missingArgs
| missingCombArgs
| opFixity
| opName
| opPrecedence
| orExps
| patArgs
| patCons
| patExpr
| patLiteral
| progFuncs
| progImports
| progName
| progOps
| progTypes
| range
| resultType
| rnmAllVars
| rnmAllVarsInFunc
| rnmAllVarsInProg
| rnmAllVarsInRule
| rnmAllVarsInTypeExpr
| rnmProg
| ruleArgs
| ruleBody
| ruleExtDecl
| tConsArgs
| tConsName
| trBranch
| trCombType
| trCons
| trExpr
| trFunc
| trOp
| trPattern
| trProg
| trRule
| trType
| trTypeExpr
| tVarIndex
| typeConsDecls
| typeName
| typeParams
| typeSyn
| typeVisibility
| updBranch
| updBranches
| updBranchExpr
| updBranchPattern
| updCases
| updCombs
| updCons
| updConsArgs
| updConsArity
| updConsName
| updConsVisibility
| updFrees
| updFunc
| updFuncArgs
| updFuncArity
| updFuncBody
| updFuncName
| updFuncRule
| updFuncType
| updFuncTypes
| updFuncVisibility
| updLets
| updLiterals
| updOp
| updOpFixity
| updOpName
| updOpPrecedence
| updOrs
| updPatArgs
| updPatCons
| updPatLiteral
| updPattern
| updProg
| updProgExps
| updProgFuncs
| updProgImports
| updProgName
| updProgOps
| updProgTypes
| updQNames
| updQNamesInConsDecl
| updQNamesInFunc
| updQNamesInProg
| updQNamesInRule
| updQNamesInType
| updQNamesInTypeExpr
| updRule
| updRuleArgs
| updRuleBody
| updRuleExtDecl
| updTCons
| updTVars
| updType
| updTypeConsDecls
| updTypeName
| updTypeParams
| updTypeSynonym
| updTypeVisibility
| updVars
| varNr
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
Type synonym: Update a b = (b -> b) -> a -> a
| Exported functions: |
:: (String -> [String] -> [TypeDecl] -> [FuncDecl] -> [OpDecl] -> a) -> Prog -> a
transform program
:: Prog -> String
get name from program
:: Prog -> [String]
get imports from program
:: Prog -> [TypeDecl]
get type declarations from program
:: Prog -> [FuncDecl]
get functions from program
:: Prog -> [OpDecl]
get infix operators from program
:: (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([FuncDecl] -> [FuncDecl]) -> ([OpDecl] -> [OpDecl]) -> Prog -> Prog
update program
:: (String -> String) -> Prog -> Prog
update name of program
:: ([String] -> [String]) -> Prog -> Prog
update imports of program
:: ([TypeDecl] -> [TypeDecl]) -> Prog -> Prog
update type declarations of program
:: ([FuncDecl] -> [FuncDecl]) -> Prog -> Prog
update functions of program
:: ([OpDecl] -> [OpDecl]) -> Prog -> Prog
update infix operators of program
:: Prog -> [Int]
get all program variables (also from patterns)
:: (Expr -> Expr) -> Prog -> Prog
lift transformation on expressions to program
:: (Int -> Int) -> Prog -> Prog
rename programs variables
:: ((String,String) -> (String,String)) -> Prog -> Prog
update all qualified names in program
:: String -> Prog -> Prog
rename program (update name of and all qualified names in program)
:: ((String,String) -> Visibility -> [Int] -> [ConsDecl] -> a) -> ((String,String) -> Visibility -> [Int] -> TypeExpr -> a) -> TypeDecl -> a
transform type declaration
:: TypeDecl -> (String,String)
get name of type declaration
:: TypeDecl -> Visibility
get visibility of type declaration
:: TypeDecl -> [Int]
get type parameters of type declaration
:: TypeDecl -> [ConsDecl]
get constructor declarations from type declaration
:: TypeDecl -> TypeExpr
get synonym of type declaration
:: TypeDecl -> Bool
is type declaration a type synonym?
:: ((String,String) -> (String,String)) -> (Visibility -> Visibility) -> ([Int] -> [Int]) -> ([ConsDecl] -> [ConsDecl]) -> (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl
update type declaration
:: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl
update name of type declaration
:: (Visibility -> Visibility) -> TypeDecl -> TypeDecl
update visibility of type declaration
:: ([Int] -> [Int]) -> TypeDecl -> TypeDecl
update type parameters of type declaration
:: ([ConsDecl] -> [ConsDecl]) -> TypeDecl -> TypeDecl
update constructor declarations of type declaration
:: (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl
update synonym of type declaration
:: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl
update all qualified names in type declaration
:: ((String,String) -> Int -> Visibility -> [TypeExpr] -> a) -> ConsDecl -> a
transform constructor declaration
:: ConsDecl -> (String,String)
get name of constructor declaration
:: ConsDecl -> Int
get arity of constructor declaration
:: ConsDecl -> Visibility
get visibility of constructor declaration
:: ConsDecl -> [TypeExpr]
get arguments of constructor declaration
:: ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl
update constructor declaration
:: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl
update name of constructor declaration
:: (Int -> Int) -> ConsDecl -> ConsDecl
update arity of constructor declaration
:: (Visibility -> Visibility) -> ConsDecl -> ConsDecl
update visibility of constructor declaration
:: ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl
update arguments of constructor declaration
:: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl
update all qualified names in constructor declaration
:: TypeExpr -> Int
get index from type variable
:: TypeExpr -> TypeExpr
get domain from functional type
:: TypeExpr -> TypeExpr
get range from functional type
:: TypeExpr -> (String,String)
get name from constructed type
:: TypeExpr -> [TypeExpr]
get arguments from constructed type
:: (Int -> a) -> ((String,String) -> [a] -> a) -> (a -> a -> a) -> TypeExpr -> a
transform type expression
:: TypeExpr -> Bool
is type expression a type variable?
:: TypeExpr -> Bool
is type declaration a constructed type?
:: TypeExpr -> Bool
is type declaration a functional type?
:: (Int -> TypeExpr) -> TypeExpr -> TypeExpr
update all type variables
:: ((String,String) -> [TypeExpr] -> TypeExpr) -> TypeExpr -> TypeExpr
update all type constructors
:: (