Module "FlatCurryGoodies.curry"

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:

trProg  :: (String -> [String] -> [TypeDecl] -> [FuncDecl] -> [OpDecl] -> a) -> Prog -> a  deterministic flexible
          transform program
progName  :: Prog -> String  deterministic 
          get name from program
progImports  :: Prog -> [String]  deterministic 
          get imports from program
progTypes  :: Prog -> [TypeDecl]  deterministic 
          get type declarations from program
progFuncs  :: Prog -> [FuncDecl]  deterministic 
          get functions from program
progOps  :: Prog -> [OpDecl]  deterministic 
          get infix operators from program
updProg  :: (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([FuncDecl] -> [FuncDecl]) -> ([OpDecl] -> [OpDecl]) -> Prog -> Prog  deterministic 
          update program
updProgName  :: (String -> String) -> Prog -> Prog  deterministic 
          update name of program
updProgImports  :: ([String] -> [String]) -> Prog -> Prog  deterministic 
          update imports of program
updProgTypes  :: ([TypeDecl] -> [TypeDecl]) -> Prog -> Prog  deterministic 
          update type declarations of program
updProgFuncs  :: ([FuncDecl] -> [FuncDecl]) -> Prog -> Prog  deterministic 
          update functions of program
updProgOps  :: ([OpDecl] -> [OpDecl]) -> Prog -> Prog  deterministic 
          update infix operators of program
allVarsInProg  :: Prog -> [Int]  deterministic 
          get all program variables (also from patterns)
updProgExps  :: (Expr -> Expr) -> Prog -> Prog  deterministic 
          lift transformation on expressions to program
rnmAllVarsInProg  :: (Int -> Int) -> Prog -> Prog  deterministic 
          rename programs variables
updQNamesInProg  :: ((String,String) -> (String,String)) -> Prog -> Prog  deterministic 
          update all qualified names in program
rnmProg  :: String -> Prog -> Prog  deterministic 
          rename program (update name of and all qualified names in program)
trType  :: ((String,String) -> Visibility -> [Int] -> [ConsDecl] -> a) -> ((String,String) -> Visibility -> [Int] -> TypeExpr -> a) -> TypeDecl -> a  deterministic flexible
          transform type declaration
typeName  :: TypeDecl -> (String,String)  deterministic 
          get name of type declaration
typeVisibility  :: TypeDecl -> Visibility  deterministic 
          get visibility of type declaration
typeParams  :: TypeDecl -> [Int]  deterministic 
          get type parameters of type declaration
typeConsDecls  :: TypeDecl -> [ConsDecl]  deterministic 
          get constructor declarations from type declaration
typeSyn  :: TypeDecl -> TypeExpr  deterministic 
          get synonym of type declaration
isTypeSyn  :: TypeDecl -> Bool  deterministic 
          is type declaration a type synonym?
updType  :: ((String,String) -> (String,String)) -> (Visibility -> Visibility) -> ([Int] -> [Int]) -> ([ConsDecl] -> [ConsDecl]) -> (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl  deterministic 
          update type declaration
updTypeName  :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  deterministic 
          update name of type declaration
updTypeVisibility  :: (Visibility -> Visibility) -> TypeDecl -> TypeDecl  deterministic 
          update visibility of type declaration
updTypeParams  :: ([Int] -> [Int]) -> TypeDecl -> TypeDecl  deterministic 
          update type parameters of type declaration
updTypeConsDecls  :: ([ConsDecl] -> [ConsDecl]) -> TypeDecl -> TypeDecl  deterministic 
          update constructor declarations of type declaration
updTypeSynonym  :: (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl  deterministic 
          update synonym of type declaration
updQNamesInType  :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  deterministic 
          update all qualified names in type declaration
trCons  :: ((String,String) -> Int -> Visibility -> [TypeExpr] -> a) -> ConsDecl -> a  deterministic flexible
          transform constructor declaration
consName  :: ConsDecl -> (String,String)  deterministic 
          get name of constructor declaration
consArity  :: ConsDecl -> Int  deterministic 
          get arity of constructor declaration
consVisibility  :: ConsDecl -> Visibility  deterministic 
          get visibility of constructor declaration
consArgs  :: ConsDecl -> [TypeExpr]  deterministic 
          get arguments of constructor declaration
updCons  :: ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl  deterministic 
          update constructor declaration
updConsName  :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  deterministic 
          update name of constructor declaration
updConsArity  :: (Int -> Int) -> ConsDecl -> ConsDecl  deterministic 
          update arity of constructor declaration
updConsVisibility  :: (Visibility -> Visibility) -> ConsDecl -> ConsDecl  deterministic 
          update visibility of constructor declaration
updConsArgs  :: ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl  deterministic 
          update arguments of constructor declaration
updQNamesInConsDecl  :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  deterministic 
          update all qualified names in constructor declaration
tVarIndex  :: TypeExpr -> Int  deterministic flexible
          get index from type variable
domain  :: TypeExpr -> TypeExpr  deterministic flexible
          get domain from functional type
range  :: TypeExpr -> TypeExpr  deterministic flexible
          get range from functional type
tConsName  :: TypeExpr -> (String,String)  deterministic flexible
          get name from constructed type
tConsArgs  :: TypeExpr -> [TypeExpr]  deterministic flexible
          get arguments from constructed type
trTypeExpr  :: (Int -> a) -> ((String,String) -> [a] -> a) -> (a -> a -> a) -> TypeExpr -> a  deterministic flexible
          transform type expression
isTVar  :: TypeExpr -> Bool  deterministic 
          is type expression a type variable?
isTCons  :: TypeExpr -> Bool  deterministic 
          is type declaration a constructed type?
isFuncType  :: TypeExpr -> Bool  deterministic 
          is type declaration a functional type?
updTVars  :: (Int -> TypeExpr) -> TypeExpr -> TypeExpr  deterministic 
          update all type variables
updTCons  :: ((String,String) -> [TypeExpr] -> TypeExpr) -> TypeExpr -> TypeExpr  deterministic 
          update all type constructors
updFuncTypes  :: (TypeExpr -> TypeExpr -> TypeExpr) -> TypeExpr -> TypeExpr  deterministic 
          update all functional types
argTypes  :: TypeExpr -> [TypeExpr]  deterministic flexible
          get argument types from functional type
resultType  :: TypeExpr -> TypeExpr  deterministic flexible
          get result type from (nested) functional type
rnmAllVarsInTypeExpr  :: (Int -> Int) -> TypeExpr -> TypeExpr  deterministic 
          rename variables in type expression
updQNamesInTypeExpr  :: ((String,String) -> (String,String)) -> TypeExpr -> TypeExpr  deterministic 
          update all qualified names in type expression
trOp  :: ((String,String) -> Fixity -> Int -> a) -> OpDecl -> a  deterministic flexible
          transform operator declaration
opName  :: OpDecl -> (String,String)  deterministic 
          get name from operator declaration
opFixity  :: OpDecl -> Fixity  deterministic 
          get fixity of operator declaration
opPrecedence  :: OpDecl -> Int  deterministic 
          get precedence of operator declaration
updOp  :: ((String,String) -> (String,String)) -> (Fixity -> Fixity) -> (Int -> Int) -> OpDecl -> OpDecl  deterministic 
          update operator declaration
updOpName  :: ((String,String) -> (String,String)) -> OpDecl -> OpDecl  deterministic 
          update name of operator declaration
updOpFixity  :: (Fixity -> Fixity) -> OpDecl -> OpDecl  deterministic 
          update fixity of operator declaration
updOpPrecedence  :: (Int -> Int) -> OpDecl -> OpDecl  deterministic 
          update precedence of operator declaration
trFunc  :: ((String,String) -> Int -> Visibility -> TypeExpr -> Rule -> a) -> FuncDecl -> a  deterministic flexible
          transform function
funcName  :: FuncDecl -> (String,String)  deterministic 
          get name of function
funcArity  :: FuncDecl -> Int  deterministic 
          get arity of function
funcVisibility  :: FuncDecl -> Visibility  deterministic 
          get visibility of function
funcType  :: FuncDecl -> TypeExpr  deterministic 
          get type of function
funcRule  :: FuncDecl -> Rule  deterministic 
          get rule of function
updFunc  :: ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> (TypeExpr -> TypeExpr) -> (Rule -> Rule) -> FuncDecl -> FuncDecl  deterministic 
          update function
updFuncName  :: ((String,String) -> (String,String)) -> FuncDecl -> FuncDecl  deterministic 
          update name of function
updFuncArity  :: (Int -> Int) -> FuncDecl -> FuncDecl  deterministic 
          update arity of function
updFuncVisibility  :: (Visibility -> Visibility) -> FuncDecl -> FuncDecl  deterministic 
          update visibility of function
updFuncType  :: (TypeExpr -> TypeExpr) -> FuncDecl -> FuncDecl  deterministic 
          update type of function
updFuncRule  :: (Rule -> Rule) -> FuncDecl -> FuncDecl  deterministic 
          update rule of function
isExternal  :: FuncDecl -> Bool  deterministic 
          is function externally defined?
allVarsInFunc  :: FuncDecl -> [Int]  deterministic 
          get variable names in a function declaration
funcArgs  :: FuncDecl -> [Int]  deterministic 
          get arguments of function, if not externally defined
funcBody  :: FuncDecl -> Expr  deterministic 
          get body of function, if not externally defined
funcRHS  :: FuncDecl -> [Expr]  deterministic rigid
          
rnmAllVarsInFunc  :: (Int -> Int) -> FuncDecl -> FuncDecl  deterministic 
          rename all variables in function
updQNamesInFunc  :: ((String,String) -> (String,String)) -> FuncDecl -> FuncDecl  deterministic 
          update all qualified names in function
updFuncArgs  :: ([Int] -> [Int]) -> FuncDecl -> FuncDecl  deterministic 
          update arguments of function, if not externally defined
updFuncBody  :: (Expr -> Expr) -> FuncDecl -> FuncDecl  deterministic 
          update body of function, if not externally defined
trRule  :: ([Int] -> Expr -> a) -> (String -> a) -> Rule -> a  deterministic flexible
          transform rule
ruleArgs  :: Rule -> [Int]  deterministic 
          get rules arguments if it's not external
ruleBody  :: Rule -> Expr  deterministic 
          get rules body if it's not external
ruleExtDecl  :: Rule -> String  deterministic 
          get rules external declaration
isRuleExternal  :: Rule -> Bool  deterministic 
          is rule external?
updRule  :: ([Int] -> [Int]) -> (Expr -> Expr) -> (String -> String) -> Rule -> Rule  deterministic 
          update rule
updRuleArgs  :: ([Int] -> [Int]) -> Rule -> Rule  deterministic 
          update rules arguments
updRuleBody  :: (Expr -> Expr) -> Rule -> Rule  deterministic 
          update rules body
updRuleExtDecl  :: (String -> String) -> Rule -> Rule  deterministic 
          update rules external declaration
allVarsInRule  :: Rule -> [Int]  deterministic 
          get variable names in a functions rule
rnmAllVarsInRule  :: (Int -> Int) -> Rule -> Rule  deterministic 
          rename all variables in rule
updQNamesInRule  :: ((String,String) -> (String,String)) -> Rule -> Rule  deterministic 
          update all qualified names in rule
trCombType  :: a -> (Int -> a) -> a -> (Int -> a) -> CombType -> a  deterministic flexible
          transform combination type
isCombTypeFuncCall  :: CombType -> Bool  deterministic 
          is type of combination FuncCall?
isCombTypeFuncPartCall  :: CombType -> Bool  deterministic 
          is type of combination FuncPartCall?
isCombTypeConsCall  :: CombType -> Bool  deterministic 
          is type of combination ConsCall?
isCombTypeConsPartCall  :: CombType -> Bool  deterministic 
          is type of combination ConsPartCall?
missingArgs  :: CombType -> Int  deterministic 
          
varNr  :: Expr -> Int  deterministic flexible
          get internal number of variable
literal  :: Expr -> Literal  deterministic flexible
          get literal if expression is literal expression
combType  :: Expr -> CombType  deterministic flexible
          get combination type of a combined expression
combName  :: Expr -> (String,String)  deterministic flexible
          get name of a combined expression
combArgs  :: Expr -> [Expr]  deterministic flexible
          get arguments of a combined expression
missingCombArgs  :: Expr -> Int  deterministic 
          get number of missing arguments if expression is combined
letBinds  :: Expr -> [(Int,Expr)]  deterministic flexible
          get indices of varoables in let declaration
letBody  :: Expr -> Expr  deterministic flexible
          get body of let declaration
freeVars  :: Expr -> [Int]  deterministic flexible
          get variable indices from declaration of free variables
freeExpr  :: Expr -> Expr  deterministic flexible
          get expression from declaration of free variables
orExps  :: Expr -> [Expr]  deterministic flexible
          get expressions from or-expression
caseType  :: Expr -> CaseType  deterministic flexible
          get case-type of case expression
caseExpr  :: Expr -> Expr  deterministic flexible
          get scrutinee of case expression
caseBranches  :: Expr -> [BranchExpr]  deterministic flexible
          get branch expressions from case expression
isVar  :: Expr -> Bool  deterministic rigid
          is expression a variable?
isLit  :: Expr -> Bool  deterministic rigid
          is expression a literal expression?
isComb  :: Expr -> Bool  deterministic rigid
          is expression combined?
isLet  :: Expr -> Bool  deterministic rigid
          is expression a let expression?
isFree  :: Expr -> Bool  deterministic rigid
          is expression a declaration of free variables?
isOr  :: Expr -> Bool  deterministic rigid
          is expression an or-expression?
isCase  :: Expr -> Bool  deterministic rigid
          is expression a case expression?
trExpr  :: (Int -> a) -> (Literal -> a) -> (CombType -> (String,String) -> [a] -> a) -> ([(Int,a)] -> a -> a) -> ([Int] -> a -> a) -> (a -> a -> a) -> (CaseType -> a -> [b] -> a) -> (Pattern -> a -> b) -> Expr -> a  deterministic flexible
          transform expression
updVars  :: (Int -> Expr) -> Expr -> Expr  deterministic 
          update all variables in given expression
updLiterals  :: (Literal -> Expr) -> Expr -> Expr  deterministic 
          update all literals in given expression
updCombs  :: (CombType -> (String,String) -> [Expr] -> Expr) -> Expr -> Expr  deterministic 
          update all combined expressions in given expression
updLets  :: ([(Int,Expr)] -> Expr -> Expr) -> Expr -> Expr  deterministic 
          update all let expressions in given expression
updFrees  :: ([Int] -> Expr -> Expr) -> Expr -> Expr  deterministic 
          update all free declarations in given expression
updOrs  :: (Expr -> Expr -> Expr) -> Expr -> Expr  deterministic 
          update all or expressions in given expression
updCases  :: (CaseType -> Expr -> [BranchExpr] -> Expr) -> Expr -> Expr  deterministic 
          update all case expressions in given expression
updBranches  :: (Pattern -> Expr -> BranchExpr) -> Expr -> Expr  deterministic 
          update all case branches in given expression
isFuncCall  :: Expr -> Bool  deterministic 
          is expression a call of a function where all arguments are provided?
isFuncPartCall  :: Expr -> Bool  deterministic 
          is expression a partial function call?
isConsCall  :: Expr -> Bool  deterministic 
          is expression a call of a constructor?
isConsPartCall  :: Expr -> Bool  deterministic 
          is expression a partial constructor call?
isGround  :: Expr -> Bool  deterministic rigid
          is expression fully evaluated?
allVars  :: Expr -> [Int]  deterministic 
          get all variables (also pattern variables) in expression
rnmAllVars  :: (Int -> Int) -> Expr -> Expr  deterministic 
          rename all variables (also in patterns) in expression
updQNames  :: ((String,String) -> (String,String)) -> Expr -> Expr  deterministic 
          update all qualified names in expression
trBranch  :: (Pattern -> Expr -> a) -> BranchExpr -> a  deterministic flexible
          transform branch expression
branchPattern  :: BranchExpr -> Pattern  deterministic 
          get pattern from branch expression
branchExpr  :: BranchExpr -> Expr  deterministic 
          get expression from branch expression
updBranch  :: (Pattern -> Pattern) -> (Expr -> Expr) -> BranchExpr -> BranchExpr  deterministic 
          update branch expression
updBranchPattern  :: (Pattern -> Pattern) -> BranchExpr -> BranchExpr  deterministic 
          update pattern of branch expression
updBranchExpr  :: (Expr -> Expr) -> BranchExpr -> BranchExpr  deterministic 
          update expression of branch expression
trPattern  :: ((String,String) -> [Int] -> a) -> (Literal -> a) -> Pattern -> a  deterministic flexible
          transform pattern
patCons  :: Pattern -> (String,String)  deterministic 
          get name from constructor pattern
patArgs  :: Pattern -> [Int]  deterministic 
          get arguments from constructor pattern
patLiteral  :: Pattern -> Literal  deterministic 
          get literal from literal pattern
isConsPattern  :: Pattern -> Bool  deterministic 
          is pattern a constructor pattern?
updPattern  :: ((String,String) -> (String,String)) -> ([Int] -> [Int]) -> (Literal -> Literal) -> Pattern -> Pattern  deterministic 
          update pattern
updPatCons  :: ((String,String) -> (String,String)) -> Pattern -> Pattern  deterministic 
          update constructors name of pattern
updPatArgs  :: ([Int] -> [Int]) -> Pattern -> Pattern  deterministic 
          update arguments of constructor pattern
updPatLiteral  :: (Literal -> Literal) -> Pattern -> Pattern  deterministic 
          update literal of pattern
patExpr  :: Pattern -> Expr  deterministic 
          build expression from pattern

 Imported modules:

FlatCurry
Prelude

 Exported datatypes:

Update

Type synonym: Update a b = (b -> b) -> a -> a



 Exported functions:

trProg :: (String -> [String] -> [TypeDecl] -> [FuncDecl] -> [OpDecl] -> a) -> Prog -> a  deterministic flexible

transform program


progName :: Prog -> String  deterministic 

get name from program


progImports :: Prog -> [String]  deterministic 

get imports from program


progTypes :: Prog -> [TypeDecl]  deterministic 

get type declarations from program


progFuncs :: Prog -> [FuncDecl]  deterministic 

get functions from program


progOps :: Prog -> [OpDecl]  deterministic 

get infix operators from program


updProg :: (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([FuncDecl] -> [FuncDecl]) -> ([OpDecl] -> [OpDecl]) -> Prog -> Prog  deterministic 

update program


updProgName :: (String -> String) -> Prog -> Prog  deterministic 

update name of program


updProgImports :: ([String] -> [String]) -> Prog -> Prog  deterministic 

update imports of program


updProgTypes :: ([TypeDecl] -> [TypeDecl]) -> Prog -> Prog  deterministic 

update type declarations of program


updProgFuncs :: ([FuncDecl] -> [FuncDecl]) -> Prog -> Prog  deterministic 

update functions of program


updProgOps :: ([OpDecl] -> [OpDecl]) -> Prog -> Prog  deterministic 

update infix operators of program


allVarsInProg :: Prog -> [Int]  deterministic 

get all program variables (also from patterns)


updProgExps :: (Expr -> Expr) -> Prog -> Prog  deterministic 

lift transformation on expressions to program


rnmAllVarsInProg :: (Int -> Int) -> Prog -> Prog  deterministic 

rename programs variables


updQNamesInProg :: ((String,String) -> (String,String)) -> Prog -> Prog  deterministic 

update all qualified names in program


rnmProg :: String -> Prog -> Prog  deterministic 

rename program (update name of and all qualified names in program)


trType :: ((String,String) -> Visibility -> [Int] -> [ConsDecl] -> a) -> ((String,String) -> Visibility -> [Int] -> TypeExpr -> a) -> TypeDecl -> a  deterministic flexible

transform type declaration


typeName :: TypeDecl -> (String,String)  deterministic 

get name of type declaration


typeVisibility :: TypeDecl -> Visibility  deterministic 

get visibility of type declaration


typeParams :: TypeDecl -> [Int]  deterministic 

get type parameters of type declaration


typeConsDecls :: TypeDecl -> [ConsDecl]  deterministic 

get constructor declarations from type declaration


typeSyn :: TypeDecl -> TypeExpr  deterministic 

get synonym of type declaration


isTypeSyn :: TypeDecl -> Bool  deterministic 

is type declaration a type synonym?


updType :: ((String,String) -> (String,String)) -> (Visibility -> Visibility) -> ([Int] -> [Int]) -> ([ConsDecl] -> [ConsDecl]) -> (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl  deterministic 

update type declaration


updTypeName :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  deterministic 

update name of type declaration


updTypeVisibility :: (Visibility -> Visibility) -> TypeDecl -> TypeDecl  deterministic 

update visibility of type declaration


updTypeParams :: ([Int] -> [Int]) -> TypeDecl -> TypeDecl  deterministic 

update type parameters of type declaration


updTypeConsDecls :: ([ConsDecl] -> [ConsDecl]) -> TypeDecl -> TypeDecl  deterministic 

update constructor declarations of type declaration


updTypeSynonym :: (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDecl  deterministic 

update synonym of type declaration


updQNamesInType :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  deterministic 

update all qualified names in type declaration


trCons :: ((String,String) -> Int -> Visibility -> [TypeExpr] -> a) -> ConsDecl -> a  deterministic flexible

transform constructor declaration


consName :: ConsDecl -> (String,String)  deterministic 

get name of constructor declaration


consArity :: ConsDecl -> Int  deterministic 

get arity of constructor declaration


consVisibility :: ConsDecl -> Visibility  deterministic 

get visibility of constructor declaration


consArgs :: ConsDecl -> [TypeExpr]  deterministic 

get arguments of constructor declaration


updCons :: ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl  deterministic 

update constructor declaration


updConsName :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  deterministic 

update name of constructor declaration


updConsArity :: (Int -> Int) -> ConsDecl -> ConsDecl  deterministic 

update arity of constructor declaration


updConsVisibility :: (Visibility -> Visibility) -> ConsDecl -> ConsDecl  deterministic 

update visibility of constructor declaration


updConsArgs :: ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDecl  deterministic 

update arguments of constructor declaration


updQNamesInConsDecl :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  deterministic 

update all qualified names in constructor declaration


tVarIndex :: TypeExpr -> Int  deterministic flexible

get index from type variable

Further infos:
  • incompletely defined
  • solution complete, i.e., able to compute all solutions

domain :: TypeExpr -> TypeExpr  deterministic flexible

get domain from functional type

Further infos:
  • incompletely defined
  • solution complete, i.e., able to compute all solutions

range :: TypeExpr -> TypeExpr  deterministic flexible

get range from functional type

Further infos:
  • incompletely defined
  • solution complete, i.e., able to compute all solutions

tConsName :: TypeExpr -> (String,String)  deterministic flexible

get name from constructed type

Further infos:
  • incompletely defined
  • solution complete, i.e., able to compute all solutions

tConsArgs :: TypeExpr -> [TypeExpr]  deterministic flexible

get arguments from constructed type

Further infos:
  • incompletely defined
  • solution complete, i.e., able to compute all solutions

trTypeExpr :: (Int -> a) -> ((String,String) -> [a] -> a) -> (a -> a -> a) -> TypeExpr -> a  deterministic flexible

transform type expression


isTVar :: TypeExpr -> Bool  deterministic 

is type expression a type variable?


isTCons :: TypeExpr -> Bool  deterministic 

is type declaration a constructed type?


isFuncType :: TypeExpr -> Bool  deterministic 

is type declaration a functional type?


updTVars :: (Int -> TypeExpr) -> TypeExpr -> TypeExpr  deterministic 

update all type variables


updTCons :: ((String,String) -> [TypeExpr] -> TypeExpr) -> TypeExpr -> TypeExpr  deterministic 

update all type constructors


updFuncTypes :: (