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

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Rewrite.ElementTypes

Contents

Synopsis

Documentation

Modules

type Module = Ann UModule IdDom SrcTemplateStage #

The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.

type ModuleHead = Ann UModuleHead IdDom SrcTemplateStage #

Module declaration with name and (optional) exports

type ExportSpecs = Ann UExportSpecs IdDom SrcTemplateStage #

A list of export specifications surrounded by parentheses

type IESpec = Ann UIESpec IdDom SrcTemplateStage #

Marks a name to be imported or exported with related names (subspecifier)

type ImportModifier = Ann UImportModifier IdDom SrcTemplateStage #

Specifies the imported element

type SubSpec = Ann USubSpec IdDom SrcTemplateStage #

Marks how related names will be imported or exported with a given name

type ModulePragma = Ann UModulePragma IdDom SrcTemplateStage #

Pragmas that must be used after the module head

type FilePragma = Ann UFilePragma IdDom SrcTemplateStage #

Pragmas that must be used before defining the module

type ImportDecl = Ann UImportDecl IdDom SrcTemplateStage #

An import declaration: import Module.Name

type ImportSpec = Ann UImportSpec IdDom SrcTemplateStage #

Restriction on the imported names

type ImportQualified = Ann UImportQualified IdDom SrcTemplateStage #

Marks the import as qualified: qualified

type ImportSource = Ann UImportSource IdDom SrcTemplateStage #

Marks the import as source: {-# SOURCE #-}

type ImportSafe = Ann UImportSafe IdDom SrcTemplateStage #

Marks the import as safe: safe

type TypeNamespace = Ann UTypeNamespace IdDom SrcTemplateStage #

Marks an imported name to belong to the type namespace: type

type ImportRenaming = Ann UImportRenaming IdDom SrcTemplateStage #

Renaming imports ( as A )

type ModuleName = Ann UModuleName IdDom SrcTemplateStage #

The name of a module

type LanguageExtension = Ann ULanguageExtension IdDom SrcTemplateStage #

The name of the enabled language extension, for example ( LambdaCase )

Declarations

type Decl = Ann UDecl IdDom SrcTemplateStage #

Haskell declaration

type ClassBody = Ann UClassBody IdDom SrcTemplateStage #

The list of declarations that can appear in a typeclass

type ClassElement = Ann UClassElement IdDom SrcTemplateStage #

Members of a class declaration

type InstBody = Ann UInstBody IdDom SrcTemplateStage #

Instance body is the implementation of the class functions ( where a x = 1; b x = 2 )

type InstBodyDecl = Ann UInstBodyDecl IdDom SrcTemplateStage #

Declarations inside an instance declaration.

type GadtConDecl = Ann UGadtConDecl IdDom SrcTemplateStage #

GADT constructor declaration ( D1 :: { val :: Int } -> T String )

type GadtConType = Ann UGadtConType IdDom SrcTemplateStage #

Type of GADT constructors (can be record types: { val :: Int })

type FieldWildcard = Ann UFieldWildcard IdDom SrcTemplateStage #

Marker for a field wildcard. Only needed to attach semantic information in a type-safe way.

type FunDeps = Ann UFunDeps IdDom SrcTemplateStage #

A list of functional dependencies: | a -> b, c -> d separated by commas

type FunDep = Ann UFunDep IdDom SrcTemplateStage #

A functional dependency, given on the form l1 ... ln -> r1 ... rn

type ConDecl = Ann UConDecl IdDom SrcTemplateStage #

A constructor declaration for a datatype

type DataOrNewtypeKeyword = Ann UDataOrNewtypeKeyword IdDom SrcTemplateStage #

The data or the newtype keyword to define ADTs.

type FieldDecl = Ann UFieldDecl IdDom SrcTemplateStage #

Field declaration ( fld :: Int )

type Deriving = Ann UDeriving IdDom SrcTemplateStage #

A deriving clause following a data type declaration. ( deriving Show or deriving (Show, Eq) )

type DeriveStrategy = Ann UDeriveStrategy IdDom SrcTemplateStage #

A deriving strategy (stock, newtype or anyclass)

type InstanceRule = Ann UInstanceRule IdDom SrcTemplateStage #

The instance declaration rule, which is, roughly, the part of the instance declaration before the where keyword.

type InstanceHead = Ann UInstanceHead IdDom SrcTemplateStage #

The specification of the class instance declaration

type OverlapPragma = Ann UOverlapPragma IdDom SrcTemplateStage #

Overlap pragmas. Can be applied to class declarations and class instance declarations.

type TypeEqn = Ann UTypeEqn IdDom SrcTemplateStage #

Type equations as found in closed type families ( T A = S )

type Rule = Ann URule IdDom SrcTemplateStage #

A rewrite rule ( "map/map" forall f g xs. map f (map g xs) = map (f.g) xs )

type RuleVar = Ann URuleVar IdDom SrcTemplateStage #

A variable for a rewrite rule. With or without type signature.

type AnnotationSubject = Ann UAnnotationSubject IdDom SrcTemplateStage #

Annotation allows you to connect an expression to any declaration.

type MinimalFormula = Ann UMinimalFormula IdDom SrcTemplateStage #

Formulas of minimal annotations declaring which functions should be defined.

type SourceRange = Ann USourceRange IdDom SrcTemplateStage #

In-AST source ranges (for generated pragmas)

type TypeFamily = Ann UTypeFamily IdDom SrcTemplateStage #

Open type and data families

type TypeFamilySpec = Ann UTypeFamilySpec IdDom SrcTemplateStage #

Type family specification with kinds specification and injectivity.

type InjectivityAnn = Ann UInjectivityAnn IdDom SrcTemplateStage #

Injectivity annotation for type families ( = r | r -> a )

type PatternSynonym = Ann UPatternSynonym IdDom SrcTemplateStage #

Pattern synonyms: pattern Arrow t1 t2 = App "->" [t1, t2]

type PatSynRhs = Ann UPatSynRhs IdDom SrcTemplateStage #

Right-hand side of pattern synonym

type PatSynLhs = Ann UPatSynLhs IdDom SrcTemplateStage #

Left hand side of a pattern synonym

type PatSynWhere = Ann UPatSynWhere IdDom SrcTemplateStage #

Where clause of pattern synonym (explicit expression direction)

type PatternSignature = Ann UPatternTypeSignature IdDom SrcTemplateStage #

Pattern type signature declaration ( pattern Succ :: Int -> Int )

type Role = Ann URole IdDom SrcTemplateStage #

Role annotations for types

type CallConv = Ann UCallConv IdDom SrcTemplateStage #

Call conventions of foreign functions

type Safety = Ann USafety IdDom SrcTemplateStage #

Safety annotations for foreign calls

type ConlikeAnnot = Ann UConlikeAnnot IdDom SrcTemplateStage #

A CONLIKE modifier for an INLINE pragma.

type PhaseControl = Ann UPhaseControl IdDom SrcTemplateStage #

Controls the activation of a rewrite rule ( [1] )

Binds

type ValueBind = Ann UValueBind IdDom SrcTemplateStage #

Value binding for top-level and local bindings

type Match = Ann UMatch IdDom SrcTemplateStage #

Clause of function binding

type MatchLhs = Ann UMatchLhs IdDom SrcTemplateStage #

Something on the left side of the match

type Rhs = Ann URhs IdDom SrcTemplateStage #

Right hand side of a value binding (possible with guards): ( = 3 or | x == 1 = 3; | otherwise = 4 )

type GuardedRhs = Ann UGuardedRhs IdDom SrcTemplateStage #

A guarded right-hand side of a value binding ( | x > 3 = 2 )

type RhsGuard = Ann URhsGuard IdDom SrcTemplateStage #

Guards for value bindings and pattern matches ( Just v x, v 1 )

type LocalBind = Ann ULocalBind IdDom SrcTemplateStage #

Bindings that are enabled in local blocks (where or let).

type LocalBinds = Ann ULocalBinds IdDom SrcTemplateStage #

Local bindings attached to a declaration ( where x = 42 )

type FixitySignature = Ann UFixitySignature IdDom SrcTemplateStage #

A fixity signature ( infixl 5 +, - ).

type TypeSignature = Ann UTypeSignature IdDom SrcTemplateStage #

A type signature ( f :: Int -> Int )

Types

type Type = Ann UType IdDom SrcTemplateStage #

Haskell types

type TyVar = Ann UTyVar IdDom SrcTemplateStage #

Type variable declarations (with possible kind annotation)

type Assertion = Ann UAssertion IdDom SrcTemplateStage #

A single assertion in the context

Kinds

type KindConstraint = Ann UKindConstraint IdDom SrcTemplateStage #

Kind constraint ( :: * -> * )

type Kind = Ann UKind IdDom SrcTemplateStage #

Haskell kinds

type PromotedKind = Ann (UPromoted UKind) IdDom SrcTemplateStage #

Values promoted to the kind level

Expressions

type Expr = Ann UExpr IdDom SrcTemplateStage #

Haskell expressions

type Alt = Ann UAlt IdDom SrcTemplateStage #

Clause of case expression ( Just x -> x + 1 )

type CaseRhs = Ann UCaseRhs IdDom SrcTemplateStage #

Right hand side of a match (possible with guards): ( -> 3 or | x == 1 -> 3; | otherwise -> 4 )

type GuardedCaseRhs = Ann UGuardedCaseRhs IdDom SrcTemplateStage #

A guarded right-hand side of pattern matches binding ( | x > 3 -> 2 )

type FieldUpdate = Ann UFieldUpdate IdDom SrcTemplateStage #

Field update expressions

type TupSecElem = Ann UTupSecElem IdDom SrcTemplateStage #

An element of a tuple section that can be an expression or missing (indicating a value from a parameter)

type ExprPragma = Ann UExprPragma IdDom SrcTemplateStage #

Pragmas that can be applied to expressions

type Cmd = Ann UCmd IdDom SrcTemplateStage #

Special expressions for arrows

type CmdAlt = Ann UCmdAlt IdDom SrcTemplateStage #

Clause of case expression for commands

Statements

type Stmt = Ann UStmt IdDom SrcTemplateStage #

A statement in a do-notation

type DoKind = Ann UDoKind IdDom SrcTemplateStage #

Keywords do or mdo to start a do-block

type CompStmt = Ann UCompStmt IdDom SrcTemplateStage #

List comprehension statement

type ListCompBody = Ann UListCompBody IdDom SrcTemplateStage #

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

type CmdStmt = Ann UCmdStmt IdDom SrcTemplateStage #

A do-notation for arrows

Patterns

type Pattern = Ann UPattern IdDom SrcTemplateStage #

Representation of patterns for pattern bindings

Template Haskell

type Splice = Ann USplice IdDom SrcTemplateStage #

A template haskell splice

type Bracket = Ann UBracket IdDom SrcTemplateStage #

Template Haskell bracket expressions

type QuasiQuote = Ann UQuasiQuote IdDom SrcTemplateStage #

Template haskell quasi-quotation: [quoter|str]

Literals

type Literal = Ann ULiteral IdDom SrcTemplateStage #

Haskell literals

Names

type Operator = Ann UOperator IdDom SrcTemplateStage #

A definition that functions as an operator

type Name = Ann UName IdDom SrcTemplateStage #

A definition that functions as a name

type QualifiedName = Ann UQualifiedName IdDom SrcTemplateStage #

Possible qualified names. Contains also implicit names. Linear implicit parameter: %x. Non-linear implicit parameter: ?x.

type NamePart = Ann UNamePart IdDom SrcTemplateStage #

Parts of a qualified name.

type StringNode = Ann UStringNode IdDom SrcTemplateStage #

Program elements formatted as string literals (import packages, pragma texts)

Optional AST elements

AST elements with multiplicity