Copyright | (c) 2016 - 2017 Finn Teegen |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
TODO
- trAProg :: (String -> [String] -> [TypeDecl] -> [AFuncDecl a] -> [OpDecl] -> b) -> AProg a -> b
- aProgName :: AProg a -> String
- aProgImports :: AProg a -> [String]
- aProgTypes :: AProg a -> [TypeDecl]
- aProgAFuncs :: AProg a -> [AFuncDecl a]
- aProgOps :: AProg a -> [OpDecl]
- updAProg :: (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([AFuncDecl a] -> [AFuncDecl a]) -> ([OpDecl] -> [OpDecl]) -> AProg a -> AProg a
- updAProgName :: Update (AProg a) String
- updAProgImports :: Update (AProg a) [String]
- updAProgTypes :: Update (AProg a) [TypeDecl]
- updAProgAFuncs :: Update (AProg a) [AFuncDecl a]
- updAProgOps :: Update (AProg a) [OpDecl]
- allVarsInAProg :: AProg a -> [(VarIndex, a)]
- updAProgAExps :: Update (AProg a) (AExpr a)
- rnmAllVarsInAProg :: Update (AProg a) VarIndex
- updQNamesInAProg :: Update (AProg a) QName
- rnmAProg :: String -> AProg a -> AProg a
- trAFunc :: (QName -> Int -> Visibility -> TypeExpr -> ARule a -> b) -> AFuncDecl a -> b
- aFuncName :: AFuncDecl a -> QName
- aFuncArity :: AFuncDecl a -> Int
- aFuncVisibility :: AFuncDecl a -> Visibility
- aFuncType :: AFuncDecl a -> TypeExpr
- aFuncARule :: AFuncDecl a -> ARule a
- updAFunc :: (QName -> QName) -> (Int -> Int) -> (Visibility -> Visibility) -> (TypeExpr -> TypeExpr) -> (ARule a -> ARule a) -> AFuncDecl a -> AFuncDecl a
- updAFuncName :: Update (AFuncDecl a) QName
- updAFuncArity :: Update (AFuncDecl a) Int
- updAFuncVisibility :: Update (AFuncDecl a) Visibility
- updFuncType :: Update (AFuncDecl a) TypeExpr
- updAFuncARule :: Update (AFuncDecl a) (ARule a)
- isPublicAFunc :: AFuncDecl a -> Bool
- isExternal :: AFuncDecl a -> Bool
- allVarsInAFunc :: AFuncDecl a -> [(VarIndex, a)]
- aFuncArgs :: AFuncDecl a -> [(VarIndex, a)]
- aFuncBody :: AFuncDecl a -> AExpr a
- aFuncRHS :: AFuncDecl a -> [AExpr a]
- rnmAllVarsInAFunc :: Update (AFuncDecl a) VarIndex
- updQNamesInAFunc :: Update (AFuncDecl a) QName
- updAFuncArgs :: Update (AFuncDecl a) [(VarIndex, a)]
- updAFuncBody :: Update (AFuncDecl a) (AExpr a)
- trARule :: (a -> [(VarIndex, a)] -> AExpr a -> b) -> (a -> String -> b) -> ARule a -> b
- aRuleAnnot :: ARule a -> a
- aRuleArgs :: ARule a -> [(VarIndex, a)]
- aRuleBody :: ARule a -> AExpr a
- aRuleExtDecl :: ARule a -> String
- isARuleExternal :: ARule a -> Bool
- updARule :: (a -> b) -> ([(VarIndex, a)] -> [(VarIndex, b)]) -> (AExpr a -> AExpr b) -> (String -> String) -> ARule a -> ARule b
- updARuleAnnot :: Update (ARule a) a
- updARuleArgs :: Update (ARule a) [(VarIndex, a)]
- updARuleBody :: Update (ARule a) (AExpr a)
- updARuleExtDecl :: Update (ARule a) String
- allVarsInARule :: ARule a -> [(VarIndex, a)]
- rnmAllVarsInARule :: Update (ARule a) VarIndex
- updQNamesInARule :: Update (ARule a) QName
- annot :: AExpr a -> a
- varNr :: AExpr a -> VarIndex
- literal :: AExpr a -> Literal
- combType :: AExpr a -> CombType
- combName :: AExpr a -> (QName, a)
- combArgs :: AExpr a -> [AExpr a]
- missingCombArgs :: AExpr a -> Int
- letBinds :: AExpr a -> [((VarIndex, a), AExpr a)]
- letBody :: AExpr a -> AExpr a
- freeVars :: AExpr a -> [(VarIndex, a)]
- freeExpr :: AExpr a -> AExpr a
- orExps :: AExpr a -> [AExpr a]
- caseType :: AExpr a -> CaseType
- caseExpr :: AExpr a -> AExpr a
- caseBranches :: AExpr a -> [ABranchExpr a]
- isAVar :: AExpr a -> Bool
- isALit :: AExpr a -> Bool
- isAComb :: AExpr a -> Bool
- isALet :: AExpr a -> Bool
- isAFree :: AExpr a -> Bool
- isAOr :: AExpr a -> Bool
- isACase :: AExpr a -> Bool
- trAExpr :: (a -> VarIndex -> b) -> (a -> Literal -> b) -> (a -> CombType -> (QName, a) -> [b] -> b) -> (a -> [((VarIndex, a), b)] -> b -> b) -> (a -> [(VarIndex, a)] -> b -> b) -> (a -> b -> b -> b) -> (a -> CaseType -> b -> [c] -> b) -> (APattern a -> b -> c) -> (a -> b -> TypeExpr -> b) -> AExpr a -> b
- updVars :: (a -> VarIndex -> AExpr a) -> AExpr a -> AExpr a
- updLiterals :: (a -> Literal -> AExpr a) -> AExpr a -> AExpr a
- updCombs :: (a -> CombType -> (QName, a) -> [AExpr a] -> AExpr a) -> AExpr a -> AExpr a
- updLets :: (a -> [((VarIndex, a), AExpr a)] -> AExpr a -> AExpr a) -> AExpr a -> AExpr a
- updFrees :: (a -> [(VarIndex, a)] -> AExpr a -> AExpr a) -> AExpr a -> AExpr a
- updOrs :: (a -> AExpr a -> AExpr a -> AExpr a) -> AExpr a -> AExpr a
- updCases :: (a -> CaseType -> AExpr a -> [ABranchExpr a] -> AExpr a) -> AExpr a -> AExpr a
- updBranches :: (APattern a -> AExpr a -> ABranchExpr a) -> AExpr a -> AExpr a
- updTypeds :: (a -> AExpr a -> TypeExpr -> AExpr a) -> AExpr a -> AExpr a
- isFuncCall :: AExpr a -> Bool
- isFuncPartCall :: AExpr a -> Bool
- isConsCall :: AExpr a -> Bool
- isConsPartCall :: AExpr a -> Bool
- isGround :: AExpr a -> Bool
- allVars :: AExpr a -> [(VarIndex, a)]
- rnmAllVars :: Update (AExpr a) VarIndex
- updQNames :: Update (AExpr a) QName
- trABranch :: (APattern a -> AExpr a -> b) -> ABranchExpr a -> b
- aBranchAPattern :: ABranchExpr a -> APattern a
- aBranchAExpr :: ABranchExpr a -> AExpr a
- updABranch :: (APattern a -> APattern a) -> (AExpr a -> AExpr a) -> ABranchExpr a -> ABranchExpr a
- updABranchAPattern :: Update (ABranchExpr a) (APattern a)
- updABranchAExpr :: Update (ABranchExpr a) (AExpr a)
- trAPattern :: (a -> (QName, a) -> [(VarIndex, a)] -> b) -> (a -> Literal -> b) -> APattern a -> b
- aPatAnnot :: APattern a -> a
- aPatCons :: APattern a -> (QName, a)
- aPatArgs :: APattern a -> [(VarIndex, a)]
- aPatLiteral :: APattern a -> Literal
- isConsPattern :: APattern a -> Bool
- updAPattern :: (a -> a) -> ((QName, a) -> (QName, a)) -> ([(VarIndex, a)] -> [(VarIndex, a)]) -> (Literal -> Literal) -> APattern a -> APattern a
- updAPatAnnot :: (a -> a) -> APattern a -> APattern a
- updAPatCons :: ((QName, a) -> (QName, a)) -> APattern a -> APattern a
- updAPatArgs :: ([(VarIndex, a)] -> [(VarIndex, a)]) -> APattern a -> APattern a
- updAPatLiteral :: (Literal -> Literal) -> APattern a -> APattern a
- aPatExpr :: APattern a -> AExpr a
- module Curry.FlatCurry.Goodies
Documentation
trAProg :: (String -> [String] -> [TypeDecl] -> [AFuncDecl a] -> [OpDecl] -> b) -> AProg a -> b Source #
transform program
aProgImports :: AProg a -> [String] Source #
get imports from program
aProgTypes :: AProg a -> [TypeDecl] Source #
get type declarations from program
aProgAFuncs :: AProg a -> [AFuncDecl a] Source #
get functions from program
updAProg :: (String -> String) -> ([String] -> [String]) -> ([TypeDecl] -> [TypeDecl]) -> ([AFuncDecl a] -> [AFuncDecl a]) -> ([OpDecl] -> [OpDecl]) -> AProg a -> AProg a Source #
update program
allVarsInAProg :: AProg a -> [(VarIndex, a)] Source #
get all program variables (also from patterns)
rnmAProg :: String -> AProg a -> AProg a Source #
rename program (update name of and all qualified names in program)
trAFunc :: (QName -> Int -> Visibility -> TypeExpr -> ARule a -> b) -> AFuncDecl a -> b Source #
transform function
aFuncArity :: AFuncDecl a -> Int Source #
get arity of function
aFuncVisibility :: AFuncDecl a -> Visibility Source #
get visibility of function
aFuncARule :: AFuncDecl a -> ARule a Source #
get rule of function
updAFunc :: (QName -> QName) -> (Int -> Int) -> (Visibility -> Visibility) -> (TypeExpr -> TypeExpr) -> (ARule a -> ARule a) -> AFuncDecl a -> AFuncDecl a Source #
update function
updAFuncVisibility :: Update (AFuncDecl a) Visibility Source #
update visibility of function
isPublicAFunc :: AFuncDecl a -> Bool Source #
is function public?
isExternal :: AFuncDecl a -> Bool Source #
is function externally defined?
allVarsInAFunc :: AFuncDecl a -> [(VarIndex, a)] Source #
get variable names in a function declaration
aFuncArgs :: AFuncDecl a -> [(VarIndex, a)] Source #
get arguments of function, if not externally defined
updAFuncArgs :: Update (AFuncDecl a) [(VarIndex, a)] Source #
update arguments of function, if not externally defined
updAFuncBody :: Update (AFuncDecl a) (AExpr a) Source #
update body of function, if not externally defined
trARule :: (a -> [(VarIndex, a)] -> AExpr a -> b) -> (a -> String -> b) -> ARule a -> b Source #
transform rule
aRuleAnnot :: ARule a -> a Source #
get rules annotation
aRuleExtDecl :: ARule a -> String Source #
get rules external declaration
isARuleExternal :: ARule a -> Bool Source #
is rule external?
updARule :: (a -> b) -> ([(VarIndex, a)] -> [(VarIndex, b)]) -> (AExpr a -> AExpr b) -> (String -> String) -> ARule a -> ARule b Source #
update rule
updARuleAnnot :: Update (ARule a) a Source #
update rules annotation
allVarsInARule :: ARule a -> [(VarIndex, a)] Source #
get variable names in a functions rule
missingCombArgs :: AExpr a -> Int Source #
get number of missing arguments if expression is combined
letBinds :: AExpr a -> [((VarIndex, a), AExpr a)] Source #
get indices of varoables in let declaration
freeVars :: AExpr a -> [(VarIndex, a)] Source #
get variable indices from declaration of free variables
caseBranches :: AExpr a -> [ABranchExpr a] Source #
get branch expressions from case expression
trAExpr :: (a -> VarIndex -> b) -> (a -> Literal -> b) -> (a -> CombType -> (QName, a) -> [b] -> b) -> (a -> [((VarIndex, a), b)] -> b -> b) -> (a -> [(VarIndex, a)] -> b -> b) -> (a -> b -> b -> b) -> (a -> CaseType -> b -> [c] -> b) -> (APattern a -> b -> c) -> (a -> b -> TypeExpr -> b) -> AExpr a -> b Source #
transform expression
updVars :: (a -> VarIndex -> AExpr a) -> AExpr a -> AExpr a Source #
update all variables in given expression
updLiterals :: (a -> Literal -> AExpr a) -> AExpr a -> AExpr a Source #
update all literals in given expression
updCombs :: (a -> CombType -> (QName, a) -> [AExpr a] -> AExpr a) -> AExpr a -> AExpr a Source #
update all combined expressions in given expression
updLets :: (a -> [((VarIndex, a), AExpr a)] -> AExpr a -> AExpr a) -> AExpr a -> AExpr a Source #
update all let expressions in given expression
updFrees :: (a -> [(VarIndex, a)] -> AExpr a -> AExpr a) -> AExpr a -> AExpr a Source #
update all free declarations in given expression
updOrs :: (a -> AExpr a -> AExpr a -> AExpr a) -> AExpr a -> AExpr a Source #
update all or expressions in given expression
updCases :: (a -> CaseType -> AExpr a -> [ABranchExpr a] -> AExpr a) -> AExpr a -> AExpr a Source #
update all case expressions in given expression
updBranches :: (APattern a -> AExpr a -> ABranchExpr a) -> AExpr a -> AExpr a Source #
update all case branches in given expression
updTypeds :: (a -> AExpr a -> TypeExpr -> AExpr a) -> AExpr a -> AExpr a Source #
update all typed expressions in given expression
isFuncCall :: AExpr a -> Bool Source #
is expression a call of a function where all arguments are provided?
isFuncPartCall :: AExpr a -> Bool Source #
is expression a partial function call?
isConsCall :: AExpr a -> Bool Source #
is expression a call of a constructor?
isConsPartCall :: AExpr a -> Bool Source #
is expression a partial constructor call?
allVars :: AExpr a -> [(VarIndex, a)] Source #
get all variables (also pattern variables) in expression
rnmAllVars :: Update (AExpr a) VarIndex Source #
rename all variables (also in patterns) in expression
aBranchAPattern :: ABranchExpr a -> APattern a Source #
get pattern from branch expression
aBranchAExpr :: ABranchExpr a -> AExpr a Source #
get expression from branch expression
updABranch :: (APattern a -> APattern a) -> (AExpr a -> AExpr a) -> ABranchExpr a -> ABranchExpr a Source #
update branch expression
updABranchAPattern :: Update (ABranchExpr a) (APattern a) Source #
update pattern of branch expression
updABranchAExpr :: Update (ABranchExpr a) (AExpr a) Source #
update expression of branch expression
trAPattern :: (a -> (QName, a) -> [(VarIndex, a)] -> b) -> (a -> Literal -> b) -> APattern a -> b Source #
transform pattern
aPatLiteral :: APattern a -> Literal Source #
get literal from literal pattern
isConsPattern :: APattern a -> Bool Source #
is pattern a constructor pattern?
updAPattern :: (a -> a) -> ((QName, a) -> (QName, a)) -> ([(VarIndex, a)] -> [(VarIndex, a)]) -> (Literal -> Literal) -> APattern a -> APattern a Source #
update pattern
updAPatAnnot :: (a -> a) -> APattern a -> APattern a Source #
update annotation of pattern
updAPatCons :: ((QName, a) -> (QName, a)) -> APattern a -> APattern a Source #
update constructors name of pattern
updAPatArgs :: ([(VarIndex, a)] -> [(VarIndex, a)]) -> APattern a -> APattern a Source #
update arguments of constructor pattern
updAPatLiteral :: (Literal -> Literal) -> APattern a -> APattern a Source #
update literal of pattern
module Curry.FlatCurry.Goodies