haskell-tools-rewrite-1.0.0.4: Facilities for generating new parts of the Haskell-Tools AST

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Rewrite.Create.Stmts

Contents

Description

Generation of statement-level AST fragments for refactorings. The bindings defined here are the AST constructor names with an "mk" prefix.

Synopsis

Documentation

mkBindStmt :: Pattern -> Expr -> Stmt Source #

Creates a binding statement ( x <- action )

mkExprStmt :: Expr -> Stmt Source #

Creates a non-binding statement ( action )

mkLetStmt :: [LocalBind] -> Stmt Source #

Creates a let statement ( let x = 3; y = 4 )

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

mkBindCmd :: Pattern -> Cmd -> CmdStmt Source #

Creates a binding command ( x <- action )

mkExprCmd :: Cmd -> CmdStmt Source #

Creates a non-binding command ( action )

mkLetStmtCmd :: [LocalBind] -> CmdStmt Source #

Creates a let command ( let x = 3; y = 4 )

mkRecCmd :: [CmdStmt] -> CmdStmt Source #

Creates a recursive binding command with ( rec b <- f a c; c <- f b a )