Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- genType :: MonadAlpha m => m Type
- genVarName :: MonadAlpha m => VarName' -> m VarName'
- genVarName' :: MonadAlpha m => m VarName'
- freeTyVars :: Type -> [TypeName]
- freeVars :: Expr' -> [VarName]
- freeVars' :: Expr' -> [VarName']
- freeVarsTarget :: Target' -> [VarName]
- freeVarsTarget' :: Target' -> [VarName']
- doesAlwaysReturn :: Statement -> Bool
- doesPossiblyReturn :: Statement -> Bool
- mapStatement :: (Statement -> [Statement]) -> Program -> Program
- mapStatementM :: Monad m => (Statement -> m [Statement]) -> Program -> m Program
- mapLargeStatement :: (Expr' -> [Statement] -> [Statement] -> [Statement]) -> (Target' -> Expr' -> [Statement] -> [Statement]) -> Program -> Program
- mapLargeStatementM :: Monad m => (Expr' -> [Statement] -> [Statement] -> m [Statement]) -> (Target' -> Expr' -> [Statement] -> m [Statement]) -> Program -> m Program
- mapStatements :: ([Statement] -> [Statement]) -> Program -> Program
- mapStatementsM :: Monad m => ([Statement] -> m [Statement]) -> Program -> m Program
- listStatements :: Program -> [Statement]
- mapSubExprM :: Monad m => (Expr' -> m Expr') -> Expr' -> m Expr'
- mapSubExpr :: (Expr' -> Expr') -> Expr' -> Expr'
- listSubExprs :: Expr' -> [Expr']
- mapExprTargetM :: Monad m => (Expr' -> m Expr') -> Target' -> m Target'
- mapExprStatementM :: Monad m => (Expr' -> m Expr') -> Statement -> m Statement
- mapExprM :: Monad m => (Expr' -> m Expr') -> Program -> m Program
- listExprs :: Program -> [Expr']
- hasFunctionCall :: Expr' -> Bool
- isSmallExpr :: Expr' -> Bool
- dropLocation :: Expr' -> Expr'
- targetVars :: Target' -> [VarName]
- targetVars' :: Target' -> [VarName']
- hasSubscriptTrg :: Target' -> Bool
- hasBareNameTrg :: Target' -> Bool
- exprToTarget :: Expr' -> Maybe Target'
- targetToExpr :: Target' -> Expr'
- toplevelMainDef :: [Statement] -> Program
- mainVarName :: VarName
- solveVarName :: VarName
- underscoreVarName :: VarName
generating symbols
genType :: MonadAlpha m => m Type Source #
genVarName :: MonadAlpha m => VarName' -> m VarName' Source #
genVarName' :: MonadAlpha m => m VarName' Source #
free variables
freeTyVars :: Type -> [TypeName] Source #
freeVars' :: Expr' -> [VarName'] Source #
freeVars
` reports all free variables with their locations, i.e. occurrences.
For examples, x + x
and x
have the same free variables x
but they have different sets of occurrences of free variable.
freeVarsTarget :: Target' -> [VarName] Source #
freeVarsTarget' :: Target' -> [VarName'] Source #
return-statements
doesAlwaysReturn :: Statement -> Bool Source #
doesPossiblyReturn :: Statement -> Bool Source #
traversing statements
mapStatementM :: Monad m => (Statement -> m [Statement]) -> Program -> m Program Source #
mapStatementM
replaces all statements in a given program using a given function.
This may breaks various constraints.
mapLargeStatement :: (Expr' -> [Statement] -> [Statement] -> [Statement]) -> (Target' -> Expr' -> [Statement] -> [Statement]) -> Program -> Program Source #
mapLargeStatementM :: Monad m => (Expr' -> [Statement] -> [Statement] -> m [Statement]) -> (Target' -> Expr' -> [Statement] -> m [Statement]) -> Program -> m Program Source #
listStatements :: Program -> [Statement] Source #
traversing sub exprs
mapSubExprM :: Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' Source #
mapSubExprM
replaces all exprs in a given expr using a given function.
This may breaks various constraints.
listSubExprs :: Expr' -> [Expr'] Source #
traversing exprs
exprs
hasFunctionCall :: Expr' -> Bool Source #
isSmallExpr :: Expr' -> Bool Source #
isSmallExpr
is true if the evaluation of a given expr trivially terminates.
dropLocation :: Expr' -> Expr' Source #
targets
targetVars :: Target' -> [VarName] Source #
targetVars' :: Target' -> [VarName'] Source #
hasSubscriptTrg :: Target' -> Bool Source #
hasBareNameTrg :: Target' -> Bool Source #
targetToExpr :: Target' -> Expr' Source #
programs
toplevelMainDef :: [Statement] -> Program Source #