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.Rules.LHS.ProblemRest

  • 6 values
  • PackageAgda-2.7.0.1
  • Exports6
  • LanguageHaskell2010
  • LicenceMIT
  • SourceProblemRest.hs

Rename the variables in a telescope using the names from a given pattern.

If there are not at least as many patterns as entries as in the telescope, the names of the remaining entries in the telescope are unchanged. If there are too many patterns, there should be a type error later.

valueinitLHSState
  1. :: Telescope

    The initial telescope delta of parameters.

  2. -> [ProblemEq]

    The problem equations inherited from the parent clause (living in delta).

  3. -> [NamedArg Pattern]

    The user patterns.

  4. -> Type

    The type the user patterns eliminate (living in delta).

  5. -> (LHSState a -> TCM a)

    Continuation for when checking the patterns is complete.

  6. -> TCM (LHSState a)

    The initial LHS state constructed from the user patterns.

#

Construct an initial LHSState from user patterns. Example: @

Case : {A : Set} → Maybe A → Set → Set → Set Case nothing B C = B Case (just _) B C = C

sample : {A : Set} (m : Maybe A) → Case m Bool (Maybe A → Bool) sample (just a) (just b) = true sample (just a) nothing = false sample nothing = true The problem generated for the first clause of sample with patterns just a, just b would be: lhsTel = [A : Set, m : Maybe A] lhsOutPat = [A, "m"] lhsProblem = Problem [A = _, "just a" = "a"] ["_", "just a"] ["just b"] [] lhsTarget = "Case m Bool (Maybe A -> Bool)" @