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