Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- genType :: MonadAlpha m => m Type
- genVarName :: MonadAlpha m => VarName -> m VarName
- genVarName' :: MonadAlpha m => m VarName
- mapTypeInBuiltin :: (Type -> Type) -> Builtin -> Builtin
- mapExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr
- mapExprToplevelExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> ToplevelExpr -> m ToplevelExpr
- mapExprProgramM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program
- mapExprM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr
- mapExprToplevelExprM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> ToplevelExpr -> m ToplevelExpr
- mapExprProgramM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program
- mapExpr :: ([(VarName, Type)] -> Expr -> Expr) -> [(VarName, Type)] -> Expr -> Expr
- mapExprToplevelExpr :: ([(VarName, Type)] -> Expr -> Expr) -> [(VarName, Type)] -> ToplevelExpr -> ToplevelExpr
- mapExprProgram :: ([(VarName, Type)] -> Expr -> Expr) -> Program -> Program
- listSubExprs :: Expr -> [Expr]
- uncurryFunTy :: Type -> ([Type], Type)
- uncurryLam :: Expr -> ([(VarName, Type)], Expr)
- curryApp :: Expr -> (Expr, [Expr])
- curryFunTy :: [Type] -> Type -> Type
- curryLam :: [(VarName, Type)] -> Expr -> Expr
- uncurryApp :: Expr -> [Expr] -> Expr
- isVectorTy :: Type -> Bool
- isVectorTy' :: [Type] -> Bool
- sizeOfVectorTy :: Type -> Maybe Int
- isMatrixTy :: Type -> Bool
- isMatrixTy' :: [Type] -> Bool
- sizeOfMatrixTy :: Type -> Maybe (Int, Int)
- isConstantTimeBuiltin :: Builtin -> Bool
- isConstantTimeExpr :: Expr -> Bool
- replaceLenF :: MonadError Error m => VarName -> VarName -> Integer -> Expr -> m Expr
Documentation
genType :: MonadAlpha m => m Type Source #
genVarName :: MonadAlpha m => VarName -> m VarName Source #
genVarName' :: MonadAlpha m => m VarName Source #
mapExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr Source #
mapExprM
` substitutes exprs using given two functions, which are called in pre-order and post-order.
mapExprToplevelExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> ToplevelExpr -> m ToplevelExpr Source #
mapExprProgramM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program Source #
mapExprM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr Source #
mapExprToplevelExprM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> ToplevelExpr -> m ToplevelExpr Source #
mapExprProgramM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program Source #
mapExprToplevelExpr :: ([(VarName, Type)] -> Expr -> Expr) -> [(VarName, Type)] -> ToplevelExpr -> ToplevelExpr Source #
listSubExprs :: Expr -> [Expr] Source #
isVectorTy :: Type -> Bool Source #
isVectorTy' :: [Type] -> Bool Source #
isMatrixTy :: Type -> Bool Source #
isMatrixTy' :: [Type] -> Bool Source #
isConstantTimeBuiltin :: Builtin -> Bool Source #
isConstantTimeExpr :: Expr -> Bool Source #
isConstantTimeExpr
checks whether given exprs are suitable to propagate.
replaceLenF :: MonadError Error m => VarName -> VarName -> Integer -> Expr -> m Expr Source #
replaceLenF
replaces len(f)
in an expr with i + k
.
* This assumes that there are no name conflicts.