HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleAgda-2.7.0.1Haskell2010

Agda.TypeChecking.CompiledClause.Match

  • 2 types
  • 3 values
  • PackageAgda-2.7.0.1
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • SourceMatch.hs

A stack entry is a triple consisting of 1. the part of the case tree to continue matching, 2. the current argument vector, and 3. a patch function taking the current argument vector back to the original argument vector.

match' tries to solve the matching problems on the Stack. In each iteration, the top problem is removed and handled.

If the top problem was a Done, we succeed.

If the top problem was a Case n and the nth argument of the problem is not a constructor or literal, we are stuck, thus, fail.

If we have a branch for the constructor/literal, we put it on the stack to continue. If we do not have a branch, we fall through to the next problem, which should be the corresponding catch-all branch.

An empty stack is an exception that can come only from an incomplete function definition.