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: November 2020
| trProg
                  ::  (String -> [String] -> [TypeDecl] -> [FuncDecl] -> [OpDecl] -> a) -> Prog -> atransform program | 
| progName
                  ::  Prog -> Stringget name from program | 
| progImports
                  ::  Prog -> [String]get imports from program | 
| progTypes
                  ::  Prog -> [TypeDecl]get type declarations from program | 
| progFuncs
                  ::  Prog -> [FuncDecl]get functions from program | 
| progOps
                  ::  Prog -> [OpDecl]get infix operators from program | 
| updProg
                  ::  (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([FuncDecl] -> [FuncDecl]) -> ([OpDecl] -> [OpDecl]) -> Prog -> Progupdate program | 
| updProgName
                  ::  (String -> String) -> Prog -> Progupdate name of program | 
| updProgImports
                  ::  ([String] -> [String]) -> Prog -> Progupdate imports of program | 
| updProgTypes
                  ::  ([TypeDecl] -> [TypeDecl]) -> Prog -> Progupdate type declarations of program | 
| updProgFuncs
                  ::  ([FuncDecl] -> [FuncDecl]) -> Prog -> Progupdate functions of program | 
| updProgOps
                  ::  ([OpDecl] -> [OpDecl]) -> Prog -> Progupdate infix operators of program | 
| allVarsInProg
                  ::  Prog -> [Int]get all program variables (also from patterns) | 
| updProgExps
                  ::  (Expr -> Expr) -> Prog -> Proglift transformation on expressions to program | 
| rnmAllVarsInProg
                  ::  (Int -> Int) -> Prog -> Progrename programs variables | 
| updQNamesInProg
                  ::  ((String,String) -> (String,String)) -> Prog -> Progupdate all qualified names in program | 
| rnmProg
                  ::  String -> Prog -> Progrename program (update name of and all qualified names in program) | 
| trType
                  ::  ((String,String) -> Visibility -> [(Int,Kind)] -> [ConsDecl] -> a) -> ((String,String) -> Visibility -> [(Int,Kind)] -> TypeExpr -> a) -> ((String,String) -> Visibility -> [(Int,Kind)] -> NewConsDecl -> a) -> TypeDecl -> atransform type declaration | 
| typeName
                  ::  TypeDecl -> (String,String)get name of type declaration | 
| typeVisibility
                  ::  TypeDecl -> Visibilityget visibility of type declaration | 
| typeParams
                  ::  TypeDecl -> [(Int,Kind)]get type parameters of type declaration | 
| typeConsDecls
                  ::  TypeDecl -> [ConsDecl]get constructor declarations from type declaration | 
| typeSyn
                  ::  TypeDecl -> TypeExprget synonym of type declaration | 
| isTypeData
                  ::  TypeDecl -> Boolis type declaration a basic data type? | 
| isTypeSyn
                  ::  TypeDecl -> Boolis type declaration a type synonym? | 
| isTypeNew
                  ::  TypeDecl -> Boolis type declaration a newtype? | 
| updType
                  ::  ((String,String) -> (String,String)) -> (Visibility -> Visibility) -> ([(Int,Kind)] -> [(Int,Kind)]) -> ([ConsDecl] -> [ConsDecl]) -> (NewConsDecl -> NewConsDecl) -> (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDeclupdate type declaration | 
| updTypeName
                  ::  ((String,String) -> (String,String)) -> TypeDecl -> TypeDeclupdate name of type declaration | 
| updTypeVisibility
                  ::  (Visibility -> Visibility) -> TypeDecl -> TypeDeclupdate visibility of type declaration | 
| updTypeParams
                  ::  ([(Int,Kind)] -> [(Int,Kind)]) -> TypeDecl -> TypeDeclupdate type parameters of type declaration | 
| updTypeConsDecls
                  ::  ([ConsDecl] -> [ConsDecl]) -> TypeDecl -> TypeDeclupdate constructor declarations of type declaration | 
| updTypeNewConsDecl
                  ::  (NewConsDecl -> NewConsDecl) -> TypeDecl -> TypeDeclupdate newtype constructor declaration of type declaration | 
| updTypeSynonym
                  ::  (TypeExpr -> TypeExpr) -> TypeDecl -> TypeDeclupdate synonym of type declaration | 
| updQNamesInType
                  ::  ((String,String) -> (String,String)) -> TypeDecl -> TypeDeclupdate all qualified names in type declaration | 
| trCons
                  ::  ((String,String) -> Int -> Visibility -> [TypeExpr] -> a) -> ConsDecl -> atransform constructor declaration | 
| consName
                  ::  ConsDecl -> (String,String)get name of constructor declaration | 
| consArity
                  ::  ConsDecl -> Intget arity of constructor declaration | 
| consVisibility
                  ::  ConsDecl -> Visibilityget visibility of constructor declaration | 
| consArgs
                  ::  ConsDecl -> [TypeExpr]get arguments of constructor declaration | 
| updCons
                  ::  ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDeclupdate constructor declaration | 
| updConsName
                  ::  ((String,String) -> (String,String)) -> ConsDecl -> ConsDeclupdate name of constructor declaration | 
| updConsArity
                  ::  (Int -> Int) -> ConsDecl -> ConsDeclupdate arity of constructor declaration | 
| updConsVisibility
                  ::  (Visibility -> Visibility) -> ConsDecl -> ConsDeclupdate visibility of constructor declaration | 
| updConsArgs
                  ::  ([TypeExpr] -> [TypeExpr]) -> ConsDecl -> ConsDeclupdate arguments of constructor declaration | 
| updQNamesInConsDecl
                  ::  ((String,String) -> (String,String)) -> ConsDecl -> ConsDeclupdate all qualified names in constructor declaration | 
| trNewCons
                  ::  ((String,String) -> Visibility -> TypeExpr -> a) -> NewConsDecl -> atransform newtype constructor declaration | 
| newConsArg
                  ::  NewConsDecl -> TypeExpr | 
| newConsName
                  ::  NewConsDecl -> (String,String) | 
| newConsVisibility
                  ::  NewConsDecl -> Visibility | 
| updNewCons
                  ::  ((String,String) -> (String,String)) -> (Visibility -> Visibility) -> (TypeExpr -> TypeExpr) -> NewConsDecl -> NewConsDeclupdate newtype constructor declaration | 
| updNewConsName
                  ::  ((String,String) -> (String,String)) -> NewConsDecl -> NewConsDeclupdate name of newtype constructor declaration | 
| updNewConsVisibility
                  ::  (Visibility -> Visibility) -> NewConsDecl -> NewConsDeclupdate visibility of newtype constructor declaration | 
| updNewConsArg
                  ::  (TypeExpr -> TypeExpr) -> NewConsDecl -> NewConsDeclupdate argument of newtype constructor declaration | 
| updQNamesInNewConsDecl
                  ::  ((String,String) -> (String,String)) -> NewConsDecl -> NewConsDecl | 
| tVarIndex
                  ::  TypeExpr -> Intget index from type variable | 
| domain
                  ::  TypeExpr -> TypeExprget domain from functional type | 
| range
                  ::  TypeExpr -> TypeExprget range from functional type | 
| tConsName
                  ::  TypeExpr -> (String,String)get name from constructed type | 
| tConsArgs
                  ::  TypeExpr -> [TypeExpr]get arguments from constructed type | 
| trTypeExpr
                  ::  (Int -> a) -> ((String,String) -> [a] -> a) -> (a -> a -> a) -> ([(Int,Kind)] -> a -> a) -> TypeExpr -> atransform type expression | 
| isTVar
                  ::  TypeExpr -> Boolis type expression a type variable? | 
| isTCons
                  ::  TypeExpr -> Boolis type declaration a constructed type? | 
| isFuncType
                  ::  TypeExpr -> Boolis type declaration a functional type? | 
| isForallType
                  ::  TypeExpr -> Boolis type declaration a forall type? | 
| updTVars
                  ::  (Int -> TypeExpr) -> TypeExpr -> TypeExprupdate all type variables | 
| updTCons
                  ::  ((String,String) -> [TypeExpr] -> TypeExpr) -> TypeExpr -> TypeExprupdate all type constructors | 
| updFuncTypes
                  ::  (TypeExpr -> TypeExpr -> TypeExpr) -> TypeExpr -> TypeExprupdate all functional types | 
| updForallTypes
                  ::  ([(Int,Kind)] -> TypeExpr -> TypeExpr) -> TypeExpr -> TypeExprupdate all forall types | 
| argTypes
                  ::  TypeExpr -> [TypeExpr]get argument types from functional type | 
| resultType
                  ::  TypeExpr -> TypeExprget result type from (nested) functional type | 
| rnmAllVarsInTypeExpr
                  ::  (Int -> Int) -> TypeExpr -> TypeExprrename variables in type expression | 
| updQNamesInTypeExpr
                  ::  ((String,String) -> (String,String)) -> TypeExpr -> TypeExprupdate all qualified names in type expression | 
| trOp
                  ::  ((String,String) -> Fixity -> Int -> a) -> OpDecl -> atransform operator declaration | 
| opName
                  ::  OpDecl -> (String,String)get name from operator declaration | 
| opFixity
                  ::  OpDecl -> Fixityget fixity of operator declaration | 
| opPrecedence
                  ::  OpDecl -> Intget precedence of operator declaration | 
| updOp
                  ::  ((String,String) -> (String,String)) -> (Fixity -> Fixity) -> (Int -> Int) -> OpDecl -> OpDeclupdate operator declaration | 
| updOpName
                  ::  ((String,String) -> (String,String)) -> OpDecl -> OpDeclupdate name of operator declaration | 
| updOpFixity
                  ::  (Fixity -> Fixity) -> OpDecl -> OpDeclupdate fixity of operator declaration | 
| updOpPrecedence
                  ::  (Int -> Int) -> OpDecl -> OpDeclupdate precedence of operator declaration | 
| trFunc
                  ::  ((String,String) -> Int -> Visibility -> TypeExpr -> Rule -> a) -> FuncDecl -> atransform function | 
| funcName
                  ::  FuncDecl -> (String,String)get name of function | 
| funcArity
                  ::  FuncDecl -> Intget arity of function | 
| funcVisibility
                  ::  FuncDecl -> Visibilityget visibility of function | 
| funcType
                  ::  FuncDecl -> TypeExprget type of function | 
| funcRule
                  ::  FuncDecl -> Ruleget rule of function | 
| updFunc
                  ::  ((String,String) -> (String,String)) -> (Int -> Int) -> (Visibility -> Visibility) -> (TypeExpr -> TypeExpr) -> (Rule -> Rule) -> FuncDecl -> FuncDeclupdate function | 
| updFuncName
                  ::  ((String,String) -> (String,String)) -> FuncDecl -> FuncDeclupdate name of function | 
| updFuncArity
                  ::  (Int -> Int) -> FuncDecl -> FuncDeclupdate arity of function | 
| updFuncVisibility
                  ::  (Visibility -> Visibility) -> FuncDecl -> FuncDeclupdate visibility of function | 
| updFuncType
                  ::  (TypeExpr -> TypeExpr) -> FuncDecl -> FuncDeclupdate type of function | 
| updFuncRule
                  ::  (Rule -> Rule) -> FuncDecl -> FuncDeclupdate rule of function | 
| isExternal
                  ::  FuncDecl -> Boolis function externally defined? | 
| allVarsInFunc
                  ::  FuncDecl -> [Int]get variable names in a function declaration | 
| funcArgs
                  ::  FuncDecl -> [Int]get arguments of function, if not externally defined | 
| funcBody
                  ::  FuncDecl -> Exprget body of function, if not externally defined | 
| funcRHS
                  ::  FuncDecl -> [Expr] | 
| rnmAllVarsInFunc
                  ::  (Int -> Int) -> FuncDecl -> FuncDeclrename all variables in function | 
| updQNamesInFunc
                  ::  ((String,String) -> (String,String)) -> FuncDecl -> FuncDeclupdate all qualified names in function | 
| updFuncArgs
                  ::  ([Int] -> [Int]) -> FuncDecl -> FuncDeclupdate arguments of function, if not externally defined | 
| updFuncBody
                  ::  (Expr -> Expr) -> FuncDecl -> FuncDeclupdate body of function, if not externally defined | 
| trRule
                  ::  ([Int] -> Expr -> a) -> (String -> a) -> Rule -> atransform rule | 
| ruleArgs
                  ::  Rule -> [Int]get rules arguments if it's not external | 
| ruleBody
                  ::  Rule -> Exprget rules body if it's not external | 
| ruleExtDecl
                  ::  Rule -> Stringget rules external declaration | 
| isRuleExternal
                  ::  Rule -> Boolis rule external? | 
| updRule
                  ::  ([Int] -> [Int]) -> (Expr -> Expr) -> (String -> String) -> Rule -> Ruleupdate rule | 
| updRuleArgs
                  ::  ([Int] -> [Int]) -> Rule -> Ruleupdate rules arguments | 
| updRuleBody
                  ::  (Expr -> Expr) -> Rule -> Ruleupdate rules body | 
| updRuleExtDecl
                  ::  (String -> String) -> Rule -> Ruleupdate rules external declaration | 
| allVarsInRule
                  ::  Rule -> [Int]get variable names in a functions rule | 
| rnmAllVarsInRule
                  ::  (Int -> Int) -> Rule -> Rulerename all variables in rule | 
| updQNamesInRule
                  ::  ((String,String) -> (String,String)) -> Rule -> Ruleupdate all qualified names in rule | 
| trCombType
                  ::  a -> (Int -> a) -> a -> (Int -> a) -> CombType -> atransform combination type | 
| isCombTypeFuncCall
                  ::  CombType -> Boolis type of combination FuncCall? | 
| isCombTypeFuncPartCall
                  ::  CombType -> Boolis type of combination FuncPartCall? | 
| isCombTypeConsCall
                  ::  CombType -> Boolis type of combination ConsCall? | 
| isCombTypeConsPartCall
                  ::  CombType -> Boolis type of combination ConsPartCall? | 
| missingArgs
                  ::  CombType -> Int | 
| varNr
                  ::  Expr -> Intget internal number of variable | 
| literal
                  ::  Expr -> Literalget literal if expression is literal expression | 
| combType
                  ::  Expr -> CombTypeget combination type of a combined expression | 
| combName
                  ::  Expr -> (String,String)get name of a combined expression | 
| combArgs
                  ::  Expr -> [Expr]get arguments of a combined expression | 
| missingCombArgs
                  ::  Expr -> Intget number of missing arguments if expression is combined | 
| letBinds
                  ::  Expr -> [(Int,Expr)]get indices of variables in let declaration | 
| letBody
                  ::  Expr -> Exprget body of let declaration | 
| freeVars
                  ::  Expr -> [Int]get variable indices from declaration of free variables | 
| freeExpr
                  ::  Expr -> Exprget expression from declaration of free variables | 
| orExps
                  ::  Expr -> [Expr]get expressions from or-expression | 
| caseType
                  ::  Expr -> CaseTypeget case-type of case expression | 
| caseExpr
                  ::  Expr -> Exprget scrutinee of case expression | 
| caseBranches
                  ::  Expr -> [BranchExpr]get branch expressions from case expression | 
| isVar
                  ::  Expr -> Boolis expression a variable? | 
| isLit
                  ::  Expr -> Boolis expression a literal expression? | 
| isComb
                  ::  Expr -> Boolis expression combined? | 
| isLet
                  ::  Expr -> Boolis expression a let expression? | 
| isFree
                  ::  Expr -> Boolis expression a declaration of free variables? | 
| isOr
                  ::  Expr -> Boolis expression an or-expression? | 
| isCase
                  ::  Expr -> Boolis 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) -> (a -> TypeExpr -> a) -> Expr -> atransform expression | 
| updVars
                  ::  (Int -> Expr) -> Expr -> Exprupdate all variables in given expression | 
| updLiterals
                  ::  (Literal -> Expr) -> Expr -> Exprupdate all literals in given expression | 
| updCombs
                  ::  (CombType -> (String,String) -> [Expr] -> Expr) -> Expr -> Exprupdate all combined expressions in given expression | 
| updLets
                  ::  ([(Int,Expr)] -> Expr -> Expr) -> Expr -> Exprupdate all let expressions in given expression | 
| updFrees
                  ::  ([Int] -> Expr -> Expr) -> Expr -> Exprupdate all free declarations in given expression | 
| updOrs
                  ::  (Expr -> Expr -> Expr) -> Expr -> Exprupdate all or expressions in given expression | 
| updCases
                  ::  (CaseType -> Expr -> [BranchExpr] -> Expr) -> Expr -> Exprupdate all case expressions in given expression | 
| updBranches
                  ::  (Pattern -> Expr -> BranchExpr) -> Expr -> Exprupdate all case branches in given expression | 
| updTypeds
                  ::  (Expr -> TypeExpr -> Expr) -> Expr -> Exprupdate all typed expressions in given expression | 
| isFuncCall
                  ::  Expr -> Boolis expression a call of a function where all arguments are provided? | 
| isFuncPartCall
                  ::  Expr -> Boolis expression a partial function call? | 
| isConsCall
                  ::  Expr -> Boolis expression a call of a constructor? | 
| isConsPartCall
                  ::  Expr -> Boolis expression a partial constructor call? | 
| isGround
                  ::  Expr -> Boolis expression fully evaluated? | 
| allVars
                  ::  Expr -> [Int]get all variables (also pattern variables) in expression | 
| rnmAllVars
                  ::  (Int -> Int) -> Expr -> Exprrename all variables (also in patterns) in expression | 
| updQNames
                  ::  ((String,String) -> (String,String)) -> Expr -> Exprupdate all qualified names in expression | 
| trBranch
                  ::  (Pattern -> Expr -> a) -> BranchExpr -> atransform branch expression | 
| branchPattern
                  ::  BranchExpr -> Patternget pattern from branch expression | 
| branchExpr
                  ::  BranchExpr -> Exprget expression from branch expression | 
| updBranch
                  ::  (Pattern -> Pattern) -> (Expr -> Expr) -> BranchExpr -> BranchExprupdate branch expression | 
| updBranchPattern
                  ::  (Pattern -> Pattern) -> BranchExpr -> BranchExprupdate pattern of branch expression | 
| updBranchExpr
                  ::  (Expr -> Expr) -> BranchExpr -> BranchExprupdate expression of branch expression | 
| trPattern
                  ::  ((String,String) -> [Int] -> a) -> (Literal -> a) -> Pattern -> atransform pattern | 
| patCons
                  ::  Pattern -> (String,String)get name from constructor pattern | 
| patArgs
                  ::  Pattern -> [Int]get arguments from constructor pattern | 
| patLiteral
                  ::  Pattern -> Literalget literal from literal pattern | 
| isConsPattern
                  ::  Pattern -> Boolis pattern a constructor pattern? | 
| updPattern
                  ::  ((String,String) -> (String,String)) -> ([Int] -> [Int]) -> (Literal -> Literal) -> Pattern -> Patternupdate pattern | 
| updPatCons
                  ::  ((String,String) -> (String,String)) -> Pattern -> Patternupdate constructors name of pattern | 
| updPatArgs
                  ::  ([Int] -> [Int]) -> Pattern -> Patternupdate arguments of constructor pattern | 
| updPatLiteral
                  ::  (Literal -> Literal) -> Pattern -> Patternupdate literal of pattern | 
| patExpr
                  ::  Pattern -> Exprbuild expression from pattern | 
              Type synonym: Update a b = (b -> b) -> a -> a
            
| 
                       transform program | 
| 
                       get imports from program | 
| 
                       update program | 
| 
                       update name of program | 
| 
                       update imports of program | 
| 
                       update type declarations of program | 
| 
                       update functions of program | 
| 
                       update infix operators of program | 
| 
                       get all program variables (also from patterns) | 
| 
                       lift transformation on expressions to program | 
| 
                       rename programs variables | 
| 
                       update all qualified names in program | 
| 
                       rename program (update name of and all qualified names in program) | 
| 
                       transform type declaration | 
| 
                       get visibility of type declaration | 
| 
                       get type parameters of type declaration | 
| 
                       get constructor declarations from type declaration | 
| 
                       is type declaration a basic data type? | 
| 
                       update type declaration | 
| 
                       update name of type declaration | 
| 
                       update visibility of type declaration | 
| 
                       update type parameters of type declaration | 
| 
                       update constructor declarations of type declaration | 
| 
                       update newtype constructor declaration of type declaration | 
| 
                       update synonym of type declaration | 
| 
                       update all qualified names in type declaration | 
| 
                       transform constructor declaration | 
| 
                       get visibility of constructor declaration | 
| 
                       update constructor declaration | 
| 
                       update name of constructor declaration | 
| 
                       update arity of constructor declaration | 
| 
                       update visibility of constructor declaration | 
| 
                       update arguments of constructor declaration | 
| 
                       update all qualified names in constructor declaration | 
| 
                       transform newtype constructor declaration | 
| 
                       | 
| 
                       | 
| 
                       update newtype constructor declaration | 
| 
                       update name of newtype constructor declaration | 
| 
                       update visibility of newtype constructor declaration | 
| 
                       update argument of newtype constructor declaration | 
| 
                       | 
| 
                       transform type expression | 
| 
                       is type declaration a functional type? | 
| 
                       is type declaration a forall type? | 
| 
                       update all type constructors | 
| 
                       update all functional types | 
| 
                       update all forall types | 
| 
                       get argument types from functional type 
 | 
| 
                       get result type from (nested) functional type 
 | 
| 
                       rename variables in type expression | 
| 
                       update all qualified names in type expression | 
| 
                       get precedence of operator declaration | 
| 
                       update operator declaration | 
| 
                       update name of operator declaration | 
| 
                       update fixity of operator declaration | 
| 
                       update precedence of operator declaration | 
| 
                       transform function | 
| 
                       get visibility of function | 
| 
                       update function | 
| 
                       update name of function | 
| 
                       update arity of function | 
| 
                       update visibility of function | 
| 
                       update type of function | 
| 
                       update rule of function | 
| 
                       is function externally defined? | 
| 
                       get variable names in a function declaration | 
| 
                       rename all variables in function | 
| 
                       update all qualified names in function | 
| 
                       update arguments of function, if not externally defined | 
| 
                       update body of function, if not externally defined | 
| 
                       get rules external declaration | 
| 
                       is rule external? | 
| 
                       update rules arguments | 
| 
                       update rules body | 
| 
                       update rules external declaration | 
| 
                       get variable names in a functions rule | 
| 
                       rename all variables in rule | 
| 
                       update all qualified names in rule | 
| 
                       transform combination type | 
| 
                       is type of combination FuncCall? | 
| 
                       is type of combination FuncPartCall? | 
| 
                       is type of combination ConsCall? | 
| 
                       is type of combination ConsPartCall? | 
| 
                       | 
| 
                       get number of missing arguments if expression is combined | 
| 
                       get branch expressions from case expression | 
| 
                       transform expression | 
| 
                       update all literals in given expression | 
| 
                       update all combined expressions in given expression | 
| 
                       update all let expressions in given expression | 
| 
                       update all free declarations in given expression | 
| 
                       update all case expressions in given expression | 
| 
                       update all case branches in given expression | 
| 
                       update all typed expressions in given expression | 
| 
                       is expression a call of a function where all arguments are provided? | 
| 
                       is expression a partial function call? | 
| 
                       is expression a call of a constructor? | 
| 
                       is expression a partial constructor call? | 
| 
                       rename all variables (also in patterns) in expression | 
| 
                       update all qualified names in expression | 
| 
                       transform branch expression | 
| 
                       get pattern from branch expression | 
| 
                       get expression from branch expression | 
| 
                       update branch expression | 
| 
                       update pattern of branch expression | 
| 
                       update expression of branch expression | 
| 
                       get literal from literal pattern | 
| 
                       is pattern a constructor pattern? | 
| 
                       update pattern | 
| 
                       update constructors name of pattern | 
| 
                       update arguments of constructor pattern | 
| 
                       update literal of pattern |