HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleAgda-2.7.0.1Haskell2010

Agda.Syntax.Concrete.Definitions

Preprocess Declarations, producing NiceDeclarations.

  • Attach fixity and syntax declarations to the definition they refer to.

  • Distribute the following attributes to the individual definitions: abstract, instance, postulate, primitive, private, termination pragmas.

  • Gather the function clauses belonging to one function definition.

  • Expand ellipsis ... in function clauses following with.

  • Infer mutual blocks. A block starts when a lone signature is encountered, and ends when all lone signatures have seen their definition.

  • Handle interleaved mutual blocks. In an `interleaved mutual' block we:

  • leave the data and fun sigs in place

  • classify signatures in constructor block based on their return type and group them all as a data def at the position in the block where the first constructor for the data sig in question occured

  • classify fun clauses based on the declared function used and group them all as a fundef at the position in the block where the first such fun clause appeared

  • Report basic well-formedness error, when one of the above transformation fails. When possible, errors should be deferred to the scope checking phase (ConcreteToAbstract), where we are in the TCM and can produce more informative error messages.

  • 10 types
  • 6 values
  • PackageAgda-2.7.0.1
  • Exports16
  • LanguageHaskell2010
  • LicenceMIT
  • SourceDefinitions.hs
datadata NiceDeclaration
#

The nice declarations. No fixity declarations and function definitions are contained in a single constructor instead of spread out between type signatures and clauses. The private, postulate, abstract and instance modifiers have been distributed to the individual declarations.

Observe the order of components:

Range Fixity' Access IsAbstract IsInstance TerminationCheck PositivityCheck

further attributes

(Q)Name

content (Expr, Declaration ...)

Constructors

Instances11Show, Generic, NFData, Pretty, HasRange, MakeAbstract, …
datadata Clause
#

One clause in a function definition. There is no guarantee that the LHS actually declares the Name. We will have to check that later.

Instances8Show, Generic, NFData, MakeAbstract, MakePrivate, ToAbstract, …
datadata DeclarationWarning
#
Instances7Show, Generic, NFData, Pretty, HasRange, EmbPrj, …
datadata DeclarationWarning'
#

Non-fatal errors encountered in the Nicifier.

Constructors

Instances7Show, Generic, NFData, Pretty, HasRange, EmbPrj, …
newtypenewtype Nice a
#

Nicifier monad. Preserve the state when throwing an exception.

Instances7Monad, Functor, Applicative, MonadError, MonadReader, MonadState, …
typetype Measure = Name
#

Termination measure is, for now, a variable name.