haskell-tools-rewrite-1.1.1.0: 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 Source #

Binding statement ( x <- action )

pattern ExprStmt :: Expr -> Stmt Source #

Non-binding statement ( action )

pattern LetStmt :: LocalBindList -> Stmt Source #

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

pattern RecStmt :: StmtList -> Stmt Source #

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

List comprehensions

pattern ListCompBody :: CompStmtList -> ListCompBody Source #

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

pattern CompStmt :: Stmt -> CompStmt Source #

Normal monadic statement of a list comprehension

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

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

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

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

Commands

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

Binding statement command ( x <- action )

pattern ExprStmtCmd :: Cmd -> CmdStmt Source #

Non-binding statement command ( action )

pattern LetStmtCmd :: LocalBindList -> CmdStmt Source #

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

pattern RecStmtCmd :: CmdStmtList -> CmdStmt Source #

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