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

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.AST.Match.Stmts

Contents

Description

UPattern matching on statement-level AST fragments for refactorings.

Synopsis

Do-notation

pattern BindStmt :: forall dom. Pattern dom -> Expr dom -> Stmt dom Source #

Binding statement ( x <- action )

pattern ExprStmt :: forall dom. Expr dom -> Stmt dom Source #

Non-binding statement ( action )

pattern LetStmt :: forall dom. LocalBindList dom -> Stmt dom Source #

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

pattern RecStmt :: forall dom. StmtList dom -> Stmt dom Source #

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

pattern DoKeyword :: forall dom. DoKind dom Source #

pattern MDoKeyword :: forall dom. DoKind dom Source #

List comprehensions

pattern ListCompBody :: forall dom. CompStmtList dom -> ListCompBody dom Source #

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

pattern CompStmt :: forall dom. Stmt dom -> CompStmt dom Source #

Normal monadic statement of a list comprehension

pattern ThenStmt :: forall dom. Expr dom -> MaybeExpr dom -> CompStmt dom Source #

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

pattern GroupStmt :: forall dom. MaybeExpr dom -> MaybeExpr dom -> CompStmt dom Source #

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

Commands

pattern BindStmtCmd :: forall dom. Pattern dom -> Cmd dom -> CmdStmt dom Source #

Binding statement command ( x <- action )

pattern ExprStmtCmd :: forall dom. Cmd dom -> CmdStmt dom Source #

Non-binding statement command ( action )

pattern LetStmtCmd :: forall dom. LocalBindList dom -> CmdStmt dom Source #

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

pattern RecStmtCmd :: forall dom. CmdStmtList dom -> CmdStmt dom Source #

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