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.Internal.Pattern

  • 6 classes
  • 14 values
  • PackageAgda-2.7.0.1
  • Exports20
  • LanguageHaskell2010
  • LicenceMIT
  • SourcePattern.hs

Tools for clauses

3 declarations
valueclauseArgs :: Clause -> Args
#

Translate the clause patterns to terms with free variables bound by the clause telescope.

Precondition: no projection patterns.

valueclauseElims :: Clause -> Elims
#

Translate the clause patterns to an elimination spine with free variables bound by the clause telescope.

classclass FunArity a where
#

Arity of a function, computed from clauses.

Methods

Instances3FunArity
  • FunArity ClauseDefined in Agda-2.7.0.1 · Agda.Syntax.Internal.Pattern

    Get the number of initial Apply patterns in a clause.

  • IsProjP p => FunArity [p]Defined in Agda-2.7.0.1 · Agda.Syntax.Internal.Pattern

    Get the number of initial Apply patterns.

  • FunArity [Clause]Defined in Agda-2.7.0.1 · Agda.Syntax.Internal.Pattern

    Get the number of common initial Apply patterns in a list of clauses.

Tools for patterns

17 declarations
classclass LabelPatVars a b where
#

Label the pattern variables from left to right using one label for each variable pattern and one for each dot pattern.

Associated types

Methods

Instances4LabelPatVars

Computes the permutation from the clause telescope to the pattern variables.

Use as fromMaybe IMPOSSIBLE . dbPatPerm to crash in a controlled way if a de Bruijn index is out of scope here.

The first argument controls whether dot patterns counts as variables or not.

Computes the permutation from the clause telescope to the pattern variables.

Use as fromMaybe IMPOSSIBLE . clausePerm to crash in a controlled way if a de Bruijn index is out of scope here.

Turn a pattern into a term. Projection patterns are turned into projection eliminations, other patterns into apply elimination.

classclass MapNamedArgPattern a p where
#

Methods

Instances2MapNamedArgPattern
  • MapNamedArgPattern a (NamedArg (Pattern' a))Defined in Agda-2.7.0.1 · Agda.Syntax.Internal.Pattern

    Modify the content of VarP, and the closest surrounding NamedArg.

    Note: the mapNamedArg for Pattern' is not expressible simply by fmap or traverse etc., since ConP has NamedArg subpatterns, which are taken into account by mapNamedArg.

  • MapNamedArgPattern a p => MapNamedArgPattern a [p]Defined in Agda-2.7.0.1 · Agda.Syntax.Internal.Pattern
classclass PatternLike a b where
#

Generic pattern traversal.

Pre-applies a pattern modification, recurses, and post-applies another one.

Methods

Instances4PatternLike
classclass PatternVarModalities p where
#

Associated types

Methods

Instances4PatternVarModalities