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

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Rewrite.Match.Stmts

Contents

Description

UPattern matching on statement-level AST fragments for refactorings.

Synopsis

Do-notation

pattern BindStmt :: Pattern -> Expr -> Stmt #

Binding statement ( x <- action )

pattern ExprStmt :: Expr -> Stmt #

Non-binding statement ( action )

pattern LetStmt :: LocalBindList -> Stmt #

Let statement ( let x = 3; y = 4 )

pattern RecStmt :: StmtList -> Stmt #

A recursive binding statement with ( rec b <- f a c; c <- f b a )

pattern DoKeyword :: DoKind #

pattern MDoKeyword :: DoKind #

List comprehensions

pattern ListCompBody :: CompStmtList -> ListCompBody #

Body of a list comprehension: ( | x <- [1..10] )

pattern CompStmt :: Stmt -> CompStmt #

Normal monadic statement of a list comprehension

pattern ThenStmt :: Expr -> MaybeExpr -> CompStmt #

Then statements by TransformListComp ( then sortWith by (x + y) )

pattern GroupStmt :: MaybeExpr -> MaybeExpr -> CompStmt #

Grouping statements by TransformListComp ( then group by (x + y) using groupWith )

Commands

pattern BindStmtCmd :: Pattern -> Cmd -> CmdStmt #

Binding statement command ( x <- action )

pattern ExprStmtCmd :: Cmd -> CmdStmt #

Non-binding statement command ( action )

pattern LetStmtCmd :: LocalBindList -> CmdStmt #

Let statement command ( let x = 3; y = 4 )

pattern RecStmtCmd :: CmdStmtList -> CmdStmt #

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