Safe Haskell | None |
---|
The concrete syntax is a raw representation of the program text without any desugaring at all. This is what the parser produces. The idea is that if we figure out how to keep the concrete syntax around, it can be printed exactly as the user wrote it.
- data Expr
- = Ident QName
- | Lit Literal
- | QuestionMark !Range (Maybe Nat)
- | Underscore !Range (Maybe String)
- | RawApp !Range [Expr]
- | App !Range Expr (NamedArg Expr)
- | OpApp !Range QName [NamedArg (OpApp Expr)]
- | WithApp !Range Expr [Expr]
- | HiddenArg !Range (Named_ Expr)
- | InstanceArg !Range (Named_ Expr)
- | Lam !Range [LamBinding] Expr
- | AbsurdLam !Range Hiding
- | ExtendedLam !Range [(LHS, RHS, WhereClause)]
- | Fun !Range Expr Expr
- | Pi Telescope Expr
- | Set !Range
- | Prop !Range
- | SetN !Range Integer
- | Rec !Range [(Name, Expr)]
- | RecUpdate !Range Expr [(Name, Expr)]
- | Let !Range [Declaration] Expr
- | Paren !Range Expr
- | Absurd !Range
- | As !Range Name Expr
- | Dot !Range Expr
- | ETel Telescope
- | QuoteGoal !Range Name Expr
- | QuoteContext !Range Name Expr
- | Quote !Range
- | QuoteTerm !Range
- | Tactic !Range Expr [Expr]
- | Unquote !Range
- | DontCare Expr
- | Equal !Range Expr Expr
- data OpApp e
- = SyntaxBindingLambda !Range [LamBinding] e
- | Ordinary e
- fromOrdinary :: e -> OpApp e -> e
- module Agda.Syntax.Concrete.Name
- appView :: Expr -> AppView
- data AppView = AppView Expr [NamedArg Expr]
- type LamBinding = LamBinding' TypedBindings
- data LamBinding' a
- = DomainFree ArgInfo BoundName
- | DomainFull a
- type TypedBindings = TypedBindings' TypedBinding
- data TypedBindings' a = TypedBindings !Range (Arg a)
- type TypedBinding = TypedBinding' Expr
- data TypedBinding' e
- data ColoredTypedBinding = WithColors [Color] TypedBinding
- data BoundName = BName {
- boundName :: Name
- boundLabel :: Name
- bnameFixity :: Fixity'
- mkBoundName_ :: Name -> BoundName
- mkBoundName :: Name -> Fixity' -> BoundName
- type Telescope = [TypedBindings]
- countTelVars :: Telescope -> Nat
- data Declaration
- = TypeSig ArgInfo Name Expr
- | Field Name (Arg Expr)
- | FunClause LHS RHS WhereClause
- | DataSig !Range Induction Name [LamBinding] Expr
- | Data !Range Induction Name [LamBinding] (Maybe Expr) [Constructor]
- | RecordSig !Range Name [LamBinding] Expr
- | Record !Range Name (Maybe (Ranged Induction)) (Maybe Name) [LamBinding] (Maybe Expr) [Declaration]
- | Infix Fixity [Name]
- | Syntax Name Notation
- | PatternSyn !Range Name [Arg Name] Pattern
- | Mutual !Range [Declaration]
- | Abstract !Range [Declaration]
- | Private !Range [Declaration]
- | InstanceB !Range [Declaration]
- | Postulate !Range [TypeSignatureOrInstanceBlock]
- | Primitive !Range [TypeSignature]
- | Open !Range QName ImportDirective
- | Import !Range QName (Maybe AsName) OpenShortHand ImportDirective
- | ModuleMacro !Range Name ModuleApplication OpenShortHand ImportDirective
- | Module !Range QName [TypedBindings] [Declaration]
- | UnquoteDecl !Range Name Expr
- | Pragma Pragma
- data ModuleApplication
- type TypeSignature = Declaration
- type TypeSignatureOrInstanceBlock = Declaration
- type Constructor = TypeSignature
- data ImportDirective = ImportDirective {
- importDirRange :: !Range
- usingOrHiding :: UsingOrHiding
- renaming :: [Renaming]
- publicOpen :: Bool
- data UsingOrHiding
- = Hiding [ImportedName]
- | Using [ImportedName]
- data ImportedName
- = ImportedModule {
- importedName :: Name
- | ImportedName {
- importedName :: Name
- = ImportedModule {
- data Renaming = Renaming {
- renFrom :: ImportedName
- renTo :: Name
- renToRange :: Range
- data AsName = AsName {}
- defaultImportDir :: ImportDirective
- data OpenShortHand
- type RewriteEqn = Expr
- type WithExpr = Expr
- data LHS
- = LHS {
- lhsOriginalPattern :: Pattern
- lhsWithPattern :: [Pattern]
- lhsRewriteEqn :: [RewriteEqn]
- lhsWithExpr :: [WithExpr]
- | Ellipsis Range [Pattern] [RewriteEqn] [WithExpr]
- = LHS {
- data Pattern
- = IdentP QName
- | QuoteP !Range
- | AppP Pattern (NamedArg Pattern)
- | RawAppP !Range [Pattern]
- | OpAppP !Range QName [NamedArg Pattern]
- | HiddenP !Range (Named_ Pattern)
- | InstanceP !Range (Named_ Pattern)
- | ParenP !Range Pattern
- | WildP !Range
- | AbsurdP !Range
- | AsP !Range Name Pattern
- | DotP !Range Expr
- | LitP Literal
- data LHSCore
- type RHS = RHS' Expr
- data RHS' e
- type WhereClause = WhereClause' [Declaration]
- data WhereClause' decls
- data Pragma
- = OptionsPragma !Range [String]
- | BuiltinPragma !Range String Expr
- | RewritePragma !Range QName
- | CompiledDataPragma !Range QName String [String]
- | CompiledTypePragma !Range QName String
- | CompiledPragma !Range QName String
- | CompiledExportPragma !Range QName String
- | CompiledEpicPragma !Range QName String
- | CompiledJSPragma !Range QName String
- | StaticPragma !Range QName
- | ImportPragma !Range String
- | ImpossiblePragma !Range
- | EtaPragma !Range QName
- | TerminationCheckPragma !Range (TerminationCheck Name)
- type Module = ([Pragma], [Declaration])
- data ThingWithFixity x = ThingWithFixity x Fixity'
- topLevelModuleName :: Module -> TopLevelModuleName
- patternHead :: Pattern -> Maybe Name
- patternNames :: Pattern -> [Name]
- type Color = Expr
- type Arg a = Arg Color a
- type NamedArg a = NamedArg Color a
- type ArgInfo = ArgInfo Color
Expressions
Concrete expressions. Should represent exactly what the user wrote.
Ident QName | ex: |
Lit Literal | ex: |
QuestionMark !Range (Maybe Nat) | ex: |
Underscore !Range (Maybe String) | ex: |
RawApp !Range [Expr] | before parsing operators |
App !Range Expr (NamedArg Expr) | ex: |
OpApp !Range QName [NamedArg (OpApp Expr)] | ex: |
WithApp !Range Expr [Expr] | ex: |
HiddenArg !Range (Named_ Expr) | ex: |
InstanceArg !Range (Named_ Expr) | ex: |
Lam !Range [LamBinding] Expr | ex: |
AbsurdLam !Range Hiding | ex: |
ExtendedLam !Range [(LHS, RHS, WhereClause)] | ex: |
Fun !Range Expr Expr | ex: |
Pi Telescope Expr | ex: |
Set !Range | ex: |
Prop !Range | ex: |
SetN !Range Integer | ex: |
Rec !Range [(Name, Expr)] | ex: |
RecUpdate !Range Expr [(Name, Expr)] | ex: |
Let !Range [Declaration] Expr | ex: |
Paren !Range Expr | ex: |
Absurd !Range | ex: |
As !Range Name Expr | ex: |
Dot !Range Expr | ex: |
ETel Telescope | only used for printing telescopes |
QuoteGoal !Range Name Expr | ex: |
QuoteContext !Range Name Expr | ex: |
Quote !Range | ex: |
QuoteTerm !Range | ex: |
Tactic !Range Expr [Expr] | tactic solve | subgoal1 | .. | subgoalN |
Unquote !Range | ex: |
DontCare Expr | to print irrelevant things |
Equal !Range Expr Expr | ex: |
SyntaxBindingLambda !Range [LamBinding] e | an abstraction inside a special syntax declaration (see Issue 358 why we introduce this). |
Ordinary e |
fromOrdinary :: e -> OpApp e -> eSource
module Agda.Syntax.Concrete.Name
Bindings
type LamBinding = LamBinding' TypedBindingsSource
A lambda binding is either domain free or typed.
data LamBinding' a Source
DomainFree ArgInfo BoundName | . |
DomainFull a | . |
Functor LamBinding' | |
Show LamBinding | |
Typeable1 LamBinding' | |
Foldable LamBinding' | |
Traversable LamBinding' | |
Pretty LamBinding | |
KillRange LamBinding | |
HasRange LamBinding | |
ExprLike LamBinding | |
ToAbstract LamBinding LamBinding | |
ToConcrete LamBinding [LamBinding] |
type TypedBindings = TypedBindings' TypedBindingSource
A sequence of typed bindings with hiding information. Appears in dependent function spaces, typed lambdas, and telescopes.
data TypedBindings' a Source
TypedBindings !Range (Arg a) | . |
type TypedBinding = TypedBinding' ExprSource
A typed binding.
data TypedBinding' e Source
TBind !Range [BoundName] e | Binding |
TLet !Range [Declaration] | Let binding |
data ColoredTypedBinding Source
Color a TypeBinding. Used by Pretty.
BName | |
|
mkBoundName_ :: Name -> BoundNameSource
mkBoundName :: Name -> Fixity' -> BoundNameSource
type Telescope = [TypedBindings]Source
A telescope is a sequence of typed bindings. Bound variables are in scope in later types.
countTelVars :: Telescope -> NatSource
Declarations
data Declaration Source
The representation type of a declaration. The comments indicate which type in the intended family the constructor targets.
data ModuleApplication Source
SectionApp Range [TypedBindings] Expr | tel. M args |
RecordModuleIFS Range QName | M {{...}} |
type TypeSignature = DeclarationSource
Just type signatures.
type TypeSignatureOrInstanceBlock = DeclarationSource
Just type signatures or instance blocks.
type Constructor = TypeSignatureSource
A data constructor declaration is just a type signature.
data ImportDirective Source
The things you are allowed to say when you shuffle names between name
spaces (i.e. in import
, namespace
, or open
declarations).
ImportDirective | |
|
data UsingOrHiding Source
data ImportedName Source
An imported name can be a module or a defined name
Eq ImportedName | |
Ord ImportedName | |
Show ImportedName | |
Typeable ImportedName | |
Pretty ImportedName | |
KillRange ImportedName | |
HasRange ImportedName |
Renaming | |
|
defaultImportDir :: ImportDirectiveSource
Default is directive is private
(use everything, but do not export).
data OpenShortHand Source
Eq OpenShortHand | |
Show OpenShortHand | |
Typeable OpenShortHand | |
Pretty OpenShortHand |
type RewriteEqn = ExprSource
Left hand sides can be written in infix style. For example:
n + suc m = suc (n + m) (f ∘ g) x = f (g x)
We use fixity information to see which name is actually defined.
LHS | original pattern, with-patterns, rewrite equations and with-expressions |
| |
Ellipsis Range [Pattern] [RewriteEqn] [WithExpr] | new with-patterns, rewrite equations and with-expressions |
Concrete patterns. No literals in patterns at the moment.
IdentP QName |
|
QuoteP !Range | quote |
AppP Pattern (NamedArg Pattern) |
|
RawAppP !Range [Pattern] |
|
OpAppP !Range QName [NamedArg Pattern] | eg: |
HiddenP !Range (Named_ Pattern) |
|
InstanceP !Range (Named_ Pattern) |
|
ParenP !Range Pattern | (p) |
WildP !Range | _ |
AbsurdP !Range | () |
AsP !Range Name Pattern |
|
DotP !Range Expr | .e |
LitP Literal |
|
Processed (scope-checked) intermediate form of the core f ps
of LHS
.
Corresponds to lhsOriginalPattern
.
LHSHead | |
| |
LHSProj | |
|
type WhereClause = WhereClause' [Declaration]Source
data WhereClause' decls Source
NoWhere | No |
AnyWhere decls | Ordinary |
SomeWhere Name decls | Named where: |
Functor WhereClause' | |
Show WhereClause | |
Typeable1 WhereClause' | |
Foldable WhereClause' | |
Traversable WhereClause' | |
Pretty WhereClause | |
KillRange WhereClause | |
HasRange WhereClause | |
ExprLike a => ExprLike (WhereClause' a) |
OptionsPragma !Range [String] | |
BuiltinPragma !Range String Expr | |
RewritePragma !Range QName | |
CompiledDataPragma !Range QName String [String] | |
CompiledTypePragma !Range QName String | |
CompiledPragma !Range QName String | |
CompiledExportPragma !Range QName String | |
CompiledEpicPragma !Range QName String | |
CompiledJSPragma !Range QName String | |
StaticPragma !Range QName | |
ImportPragma !Range String | Invariant: The string must be a valid Haskell module name. |
ImpossiblePragma !Range | |
EtaPragma !Range QName | |
TerminationCheckPragma !Range (TerminationCheck Name) |
Show Pragma | |
Typeable Pragma | |
Pretty Pragma | |
KillRange Pragma | |
HasRange Pragma | |
ToConcrete RangeAndPragma Pragma | |
ToAbstract Pragma [Pragma] |
type Module = ([Pragma], [Declaration])Source
Modules: Top-level pragmas plus other top-level declarations.
data ThingWithFixity x Source
Functor ThingWithFixity | |
Typeable1 ThingWithFixity | |
Foldable ThingWithFixity | |
Traversable ThingWithFixity | |
Show x => Show (ThingWithFixity x) | |
Pretty (ThingWithFixity Name) | |
KillRange x => KillRange (ThingWithFixity x) |
topLevelModuleName :: Module -> TopLevelModuleNameSource
Computes the top-level module name.
Precondition: The Module
has to be well-formed.
Pattern tools
patternHead :: Pattern -> Maybe NameSource
Get the leftmost symbol in a pattern.
patternNames :: Pattern -> [Name]Source
Get all the identifiers in a pattern in left-to-right order.