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.TypeChecking.Telescope

  • 3 types
  • 1 class
  • 60 values
  • PackageAgda-2.7.0.1
  • Exports64
  • LanguageHaskell2010
  • LicenceMIT
  • SourceTelescope.hs

Order a flattened telescope in the correct dependeny order: Γ -> Permutation (Γ -> Γ~)

Since reorderTel tel uses free variable analysis of type in tel, the telescope should be normalised.

Permute telescope: permutes or drops the types in the telescope according to the given permutation. Assumes that the permutation preserves the dependencies in the telescope.

For example (Andreas, 2016-12-18, issue #2344): tel = (A : Set) (X : _18 A) (i : Fin (_m_23 A X)) tel (de Bruijn) = 2:Set, 1:_18 0, 0:Fin(_m_23 1 0) flattenTel tel = 2:Set, 1:_18 0, 0:Fin(_m_23 1 0) |- [ Set, _18 2, Fin (_m_23 2 1) ] perm = 0,1,2 -> 0,1 (picks the first two) renaming _ perm = [var 0, var 1, error] -- THE WRONG RENAMING! renaming _ (flipP perm) = [error, var 1, var 0] -- The correct renaming! apply to flattened tel = ... |- [ Set, _18 1, Fin (_m_23 1 0) ] permute perm it = ... |- [ Set, _18 1 ] unflatten (de Bruijn) = 1:Set, 0: _18 0 unflatten = (A : Set) (X : _18 A)

Recursively computes dependencies of a set of variables in a given telescope. Any dependencies outside of the telescope are ignored.

Computes the set of variables in a telescope whose type depend on one of the variables in the given set (including recursive dependencies). Any dependencies outside of the telescope are ignored.

valuesplitTelescope
  1. :: VarSet

    A set of de Bruijn indices.

  2. -> Telescope

    Original telescope.

  3. -> SplitTel

    firstPart mentions the given variables, secondPart not.

#

Split a telescope into the part that defines the given variables and the part that doesn't.

See Agda.TypeChecking.Tests.prop_splitTelescope.

valuesplitTelescopeExact
  1. :: [Int]

    A list of de Bruijn indices

  2. -> Telescope

    The telescope to split

  3. -> Maybe SplitTel

    firstPart mentions the given variables in the given order, secondPart contains all other variables

#

As splitTelescope, but fails if any additional variables or reordering would be needed to make the first part well-typed.

valuetelViewUpToPath :: PureTCM m => Int -> Type -> m TelView
#

telViewUpToPath n t takes off $t$ the first n (or arbitrary many if n < 0) function domains or Path types.

telViewUpToPath n t = fst $ telViewUpToPathBoundary'n t

Like telViewUpToPath but also returns the Boundary expected by the Path types encountered. The boundary terms live in the telescope given by the TelView. Each point of the boundary has the type of the codomain of the Path type it got taken from, see fullBoundary.

(TelV Γ b, [(i,t_i,u_i)]) <- telViewUpToPathBoundaryP n a Input: Δ ⊢ a Output: Δ.Γ ⊢ b Δ.Γ ⊢ T is the codomain of the PathP at variable i Δ.Γ ⊢ i : I Δ.Γ ⊢ [ (i=0) -> t_i; (i=1) -> u_i ] : T Useful to reconstruct IApplyP patterns after teleNamedArgs Γ.

valueteleElims :: DeBruijn a => Telescope -> Boundary' (a, a) -> [Elim' a]
#

teleElimsB args bs = es Input: Δ.Γ ⊢ args : Γ Δ.Γ ⊢ T is the codomain of the PathP at variable i Δ.Γ ⊢ i : I Δ.Γ ⊢ bs = [ (i=0) -> t_i; (i=1) -> u_i ] : T Output: Δ.Γ | PiPath Γ bs A ⊢ es : A

valueifPi
  1. :: MonadReduce m
  2. => Term
  3. -> Dom Type -> Abs Type -> m a
  4. -> Term -> m a
  5. -> m a
#

If the given type is a Pi, pass its parts to the first continuation. If not (or blocked), pass the reduced type to the second continuation.

valueifPiType
  1. :: MonadReduce m
  2. => Type
  3. -> Dom Type -> Abs Type -> m a
  4. -> Type -> m a
  5. -> m a
#

If the given type is a Pi, pass its parts to the first continuation. If not (or blocked), pass the reduced type to the second continuation.

valueifNotPi
  1. :: MonadReduce m
  2. => Term
  3. -> Term -> m a
  4. -> Dom Type -> Abs Type -> m a
  5. -> m a
#

If the given type is blocked or not a Pi, pass it reduced to the first continuation. If it is a Pi, pass its parts to the second continuation.

valueifNotPiType
  1. :: MonadReduce m
  2. => Type
  3. -> Type -> m a
  4. -> Dom Type -> Abs Type -> m a
  5. -> m a
#

If the given type is blocked or not a Pi, pass it reduced to the first continuation. If it is a Pi, pass its parts to the second continuation.

classclass PiApplyM a where
#

A safe variant of piApply.

Methods

Instances4PiApplyM