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.Rules.Data

  • 1 type
  • 21 values
  • PackageAgda-2.7.0.1
  • Exports22
  • LanguageHaskell2010
  • LicenceMIT
  • SourceData.hs

Datatypes

22 declarations
valuecheckDataSort :: QName -> Sort -> TCM ()
#

Make sure that the target universe admits data type definitions. E.g. IUniv, SizeUniv etc. do not accept new constructions.

valuecheckConstructor
  1. :: QName

    Name of data type.

  2. -> UniverseCheck

    Check universes?

  3. -> Telescope

    Parameter telescope.

  4. -> Nat

    Number of indices of the data type.

  5. -> Sort

    Sort of the data type.

  6. -> Constructor

    Constructor declaration (type signature).

  7. -> TCM IsPathCons
#

Type check a constructor declaration. Checks that the constructor targets the datatype and that it fits inside the declared sort. Returns the non-linear parameters.

valuedefineTranspForFields
  1. :: Maybe Term

    PathCons, Δ.Φ ⊢ u : R δ

  2. -> (Term -> QName -> Term)

    how to apply a "projection" to a term

  3. -> QName

    some name, e.g. record name

  4. -> Telescope

    param types Δ

  5. -> Tele (Dom CType)

    fields' types Δ ⊢ Φ

  6. -> [Arg QName]

    fields' names

  7. -> Type

    record type Δ ⊢ T

  8. -> TCM ((QName, Telescope, Type, [Dom Type], [Term]), Substitution)

    ((name, tel, rtype, clause_types, bodies), sigma) name: name of transport function for this constructor/record. clauses still missing. tel: Ξ telescope for the RHS, Ξ ⊃ (Δ^I, φ : I), also Ξ ⊢ us0 : Φ[δ 0] rtype: Ξ ⊢ T' := T[δ 1] clause_types: Ξ ⊢ Φ' := Φ[δ 1] bodies: Ξ ⊢ us1 : Φ' sigma: Ξ, i : I ⊢ σ : Δ.Φ -- line [δ 0,us0] ≡ [δ 0,us1]

#
valuebindParameters
  1. :: Int

    Number of parameters

  2. -> [LamBinding]

    Bindings from definition site.

  3. -> Type

    Pi-type of bindings coming from signature site.

  4. -> (Telescope -> Type -> TCM a)

    Continuation, accepting parameter telescope and rest of type. The parameters are part of the context when the continutation is invoked.

  5. -> TCM a
#

Bind the parameters of a datatype.

We allow omission of hidden parameters at the definition site. Example: data D {a} (A : Set a) : Set a data D A where c : A -> D A

valuefitsIn :: QName -> UniverseCheck -> [IsForced] -> Type -> Sort -> TCM Int
#

Check that the arguments to a constructor fits inside the sort of the datatype. The third argument is the type of the constructor.

When --without-K is active and the type is fibrant the procedure also checks that the type is usable at the current modality. See #4784 and #5434.

As a side effect, return the arity of the constructor.

valuecheckIndexSorts :: Sort -> Telescope -> TCM ()
#

When --without-K is enabled, we should check that the sorts of the index types fit into the sort of the datatype.

datadata IsPathCons
#

Return the parameters that share variables with the indices nonLinearParameters :: Int -> Type -> TCM [Int] nonLinearParameters nPars t =

Instances2Eq, Show
  • Eq IsPathConsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.Data
  • Show IsPathConsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.Data
valueconstructs :: Int -> Int -> Type -> QName -> TCM IsPathCons
#

Check that a type constructs something of the given datatype. The first argument is the number of parameters to the datatype and the second the number of additional non-parameters in the context (1 when generalizing, 0 otherwise).