| 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 Source #
Creates a binding statement ( x <- action )
mkExprStmt :: Expr dom -> Stmt dom Source #
Creates a non-binding statement ( action )
mkRecStmt :: [Stmt dom] -> Stmt dom Source #
Creates a recursive binding statement with ( rec b <- f a c; c <- f b a )
List comprehensions
mkListCompBody :: [CompStmt dom] -> ListCompBody dom Source #
Body of a list comprehension: ( | x <- [1..10] )
mkCompStmt :: Stmt dom -> CompStmt dom Source #
Normal monadic statement of a list comprehension
mkThenStmt :: Expr dom -> Maybe (Expr dom) -> CompStmt dom Source #
Then statements by TransformListComp ( then sortWith by (x + y) )
mkGroupStmt :: Maybe (Expr dom) -> Maybe (Expr dom) -> CompStmt dom Source #
Grouping statements by TransformListComp ( then group by (x + y) using groupWith )
Commands
mkBindCmd :: Pattern dom -> Cmd dom -> CmdStmt dom Source #
Creates a binding command ( x <- action )
mkLetStmtCmd :: [LocalBind dom] -> CmdStmt dom Source #
Creates a let command ( let x = 3; y = 4 )