Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generation of statement-level AST fragments for refactorings. The bindings defined here are the AST constructor names with an "mk" prefix.
Synopsis
- mkBindStmt :: Pattern -> Expr -> Stmt
- mkExprStmt :: Expr -> Stmt
- mkLetStmt :: [LocalBind] -> Stmt
- mkRecStmt :: [Stmt] -> Stmt
- mkListCompBody :: [CompStmt] -> ListCompBody
- mkCompStmt :: Stmt -> CompStmt
- mkThenStmt :: Expr -> Maybe Expr -> CompStmt
- mkGroupStmt :: Maybe Expr -> Maybe Expr -> CompStmt
- mkBindCmd :: Pattern -> Cmd -> CmdStmt
- mkExprCmd :: Cmd -> CmdStmt
- mkLetStmtCmd :: [LocalBind] -> CmdStmt
- mkRecCmd :: [CmdStmt] -> CmdStmt
Documentation
mkExprStmt :: Expr -> Stmt Source #
Creates a non-binding statement ( action
)
mkRecStmt :: [Stmt] -> Stmt Source #
Creates a recursive binding statement with ( rec b <- f a c; c <- f b a
)
List comprehensions
mkListCompBody :: [CompStmt] -> ListCompBody Source #
Body of a list comprehension: ( | x <- [1..10]
)
mkCompStmt :: Stmt -> CompStmt Source #
Normal monadic statement of a list comprehension
mkThenStmt :: Expr -> Maybe Expr -> CompStmt Source #
Then statements by TransformListComp
( then sortWith by (x + y)
)
mkGroupStmt :: Maybe Expr -> Maybe Expr -> CompStmt Source #
Grouping statements by TransformListComp
( then group by (x + y) using groupWith
)
Commands
mkLetStmtCmd :: [LocalBind] -> CmdStmt Source #
Creates a let command ( let x = 3; y = 4
)