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

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 Source #

Module declaration with name and (optional) exports

type ExportSpecs = Ann UExportSpecs IdDom SrcTemplateStage Source #

A list of export specifications surrounded by parentheses

type IESpec = Ann UIESpec IdDom SrcTemplateStage Source #

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

type ImportModifier = Ann UImportModifier IdDom SrcTemplateStage Source #

Specifies the imported element

type SubSpec = Ann USubSpec IdDom SrcTemplateStage Source #

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

type ModulePragma = Ann UModulePragma IdDom SrcTemplateStage Source #

Pragmas that must be used after the module head

type FilePragma = Ann UFilePragma IdDom SrcTemplateStage Source #

Pragmas that must be used before defining the module

type ImportDecl = Ann UImportDecl IdDom SrcTemplateStage Source #

An import declaration: import Module.Name

type ImportSpec = Ann UImportSpec IdDom SrcTemplateStage Source #

Restriction on the imported names

type ImportQualified = Ann UImportQualified IdDom SrcTemplateStage Source #

Marks the import as qualified: qualified

type ImportSource = Ann UImportSource IdDom SrcTemplateStage Source #

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

type ImportSafe = Ann UImportSafe IdDom SrcTemplateStage Source #

Marks the import as safe: safe

type TypeNamespace = Ann UTypeNamespace IdDom SrcTemplateStage Source #

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

type LanguageExtension = Ann ULanguageExtension IdDom SrcTemplateStage Source #

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

Declarations

type Decl = Ann UDecl IdDom SrcTemplateStage Source #

Haskell declaration

type ClassBody = Ann UClassBody IdDom SrcTemplateStage Source #

The list of declarations that can appear in a typeclass

type ClassElement = Ann UClassElement IdDom SrcTemplateStage Source #

Members of a class declaration

type InstBody = Ann UInstBody IdDom SrcTemplateStage Source #

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

type InstBodyDecl = Ann UInstBodyDecl IdDom SrcTemplateStage Source #

Declarations inside an instance declaration.

type GadtConDecl = Ann UGadtConDecl IdDom SrcTemplateStage Source #

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

type GadtConType = Ann UGadtConType IdDom SrcTemplateStage Source #

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

type FieldWildcard = Ann UFieldWildcard IdDom SrcTemplateStage Source #

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

type FunDeps = Ann UFunDeps IdDom SrcTemplateStage Source #

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

type FunDep = Ann UFunDep IdDom SrcTemplateStage Source #

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

type ConDecl = Ann UConDecl IdDom SrcTemplateStage Source #

A constructor declaration for a datatype

type DataOrNewtypeKeyword = Ann UDataOrNewtypeKeyword IdDom SrcTemplateStage Source #

The data or the newtype keyword to define ADTs.

type FieldDecl = Ann UFieldDecl IdDom SrcTemplateStage Source #

Field declaration ( fld :: Int )

type Deriving = Ann UDeriving IdDom SrcTemplateStage Source #

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

type DeriveStrategy = Ann UDeriveStrategy IdDom SrcTemplateStage Source #

A deriving strategy (stock, newtype or anyclass)

type InstanceRule = Ann UInstanceRule IdDom SrcTemplateStage Source #

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

type InstanceHead = Ann UInstanceHead IdDom SrcTemplateStage Source #

The specification of the class instance declaration

type OverlapPragma = Ann UOverlapPragma IdDom SrcTemplateStage Source #

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

type TypeEqn = Ann UTypeEqn IdDom SrcTemplateStage Source #

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

type Rule = Ann URule IdDom SrcTemplateStage Source #

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

type RuleVar = Ann URuleVar IdDom SrcTemplateStage Source #

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

type AnnotationSubject = Ann UAnnotationSubject IdDom SrcTemplateStage Source #

Annotation allows you to connect an expression to any declaration.

type MinimalFormula = Ann UMinimalFormula IdDom SrcTemplateStage Source #

Formulas of minimal annotations declaring which functions should be defined.

type SourceRange = Ann USourceRange IdDom SrcTemplateStage Source #

In-AST source ranges (for generated pragmas)

type TypeFamily = Ann UTypeFamily IdDom SrcTemplateStage Source #

Open type and data families

type TypeFamilySpec = Ann UTypeFamilySpec IdDom SrcTemplateStage Source #

Type family specification with kinds specification and injectivity.

type InjectivityAnn = Ann UInjectivityAnn IdDom SrcTemplateStage Source #

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

type PatternSynonym = Ann UPatternSynonym IdDom SrcTemplateStage Source #

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

type PatSynRhs = Ann UPatSynRhs IdDom SrcTemplateStage Source #

Right-hand side of pattern synonym

type PatSynLhs = Ann UPatSynLhs IdDom SrcTemplateStage Source #

Left hand side of a pattern synonym

type PatSynWhere = Ann UPatSynWhere IdDom SrcTemplateStage Source #

Where clause of pattern synonym (explicit expression direction)

type PatternSignature = Ann UPatternTypeSignature IdDom SrcTemplateStage Source #

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

type Role = Ann URole IdDom SrcTemplateStage Source #

Role annotations for types

type CallConv = Ann UCallConv IdDom SrcTemplateStage Source #

Call conventions of foreign functions

type Safety = Ann USafety IdDom SrcTemplateStage Source #

Safety annotations for foreign calls

type ConlikeAnnot = Ann UConlikeAnnot IdDom SrcTemplateStage Source #

A CONLIKE modifier for an INLINE pragma.

type PhaseControl = Ann UPhaseControl IdDom SrcTemplateStage Source #

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

Binds

type ValueBind = Ann UValueBind IdDom SrcTemplateStage Source #

Value binding for top-level and local bindings

type Match = Ann UMatch IdDom SrcTemplateStage Source #

Clause of function binding

type MatchLhs = Ann UMatchLhs IdDom SrcTemplateStage Source #

Something on the left side of the match

type Rhs = Ann URhs IdDom SrcTemplateStage Source #

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

type GuardedRhs = Ann UGuardedRhs IdDom SrcTemplateStage Source #

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

type RhsGuard = Ann URhsGuard IdDom SrcTemplateStage Source #

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

type LocalBind = Ann ULocalBind IdDom SrcTemplateStage Source #

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

type LocalBinds = Ann ULocalBinds IdDom SrcTemplateStage Source #

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

type FixitySignature = Ann UFixitySignature IdDom SrcTemplateStage Source #

A fixity signature ( infixl 5 +, - ).

type TypeSignature = Ann UTypeSignature IdDom SrcTemplateStage Source #

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

Types

type TyVar = Ann UTyVar IdDom SrcTemplateStage Source #

Type variable declarations (with possible kind annotation)

type Assertion = Ann UAssertion IdDom SrcTemplateStage Source #

A single assertion in the context

Kinds

type KindConstraint = Ann UKindConstraint IdDom SrcTemplateStage Source #

Kind constraint ( :: * -> * )

type PromotedKind = Ann (UPromoted UKind) IdDom SrcTemplateStage Source #

Values promoted to the kind level

Expressions

type Expr = Ann UExpr IdDom SrcTemplateStage Source #

Haskell expressions

type Alt = Ann UAlt IdDom SrcTemplateStage Source #

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

type CaseRhs = Ann UCaseRhs IdDom SrcTemplateStage Source #

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

type GuardedCaseRhs = Ann UGuardedCaseRhs IdDom SrcTemplateStage Source #

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

type FieldUpdate = Ann UFieldUpdate IdDom SrcTemplateStage Source #

Field update expressions

type TupSecElem = Ann UTupSecElem IdDom SrcTemplateStage Source #

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 Source #

Pragmas that can be applied to expressions

type Cmd = Ann UCmd IdDom SrcTemplateStage Source #

Special expressions for arrows

type CmdAlt = Ann UCmdAlt IdDom SrcTemplateStage Source #

Clause of case expression for commands

Statements

type Stmt = Ann UStmt IdDom SrcTemplateStage Source #

A statement in a do-notation

type DoKind = Ann UDoKind IdDom SrcTemplateStage Source #

Keywords do or mdo to start a do-block

type CompStmt = Ann UCompStmt IdDom SrcTemplateStage Source #

List comprehension statement

type ListCompBody = Ann UListCompBody IdDom SrcTemplateStage Source #

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

type CmdStmt = Ann UCmdStmt IdDom SrcTemplateStage Source #

A do-notation for arrows

Patterns

type Pattern = Ann UPattern IdDom SrcTemplateStage Source #

Representation of patterns for pattern bindings

Template Haskell

type Splice = Ann USplice IdDom SrcTemplateStage Source #

A template haskell splice

type Bracket = Ann UBracket IdDom SrcTemplateStage Source #

Template Haskell bracket expressions

type QuasiQuote = Ann UQuasiQuote IdDom SrcTemplateStage Source #

Template haskell quasi-quotation: [quoter|str]

Literals

Names

type Operator = Ann UOperator IdDom SrcTemplateStage Source #

A definition that functions as an operator

type Name = Ann UName IdDom SrcTemplateStage Source #

A definition that functions as a name

type QualifiedName = Ann UQualifiedName IdDom SrcTemplateStage Source #

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

type NamePart = Ann UNamePart IdDom SrcTemplateStage Source #

Parts of a qualified name.

type StringNode = Ann UStringNode IdDom SrcTemplateStage Source #

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

Optional AST elements

AST elements with multiplicity