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

Safe HaskellNone
LanguageHaskell2010

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.

Synopsis

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 )

mkLetStmt :: [LocalBind dom] -> Stmt dom Source #

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

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 )

mkExprCmd :: Cmd dom -> CmdStmt dom Source #

Creates a non-binding command ( action )

mkLetStmtCmd :: [LocalBind dom] -> CmdStmt dom Source #

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

mkRecCmd :: [CmdStmt dom] -> CmdStmt dom Source #

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