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.Datatypes

  • 1 type
  • 22 values
  • PackageAgda-2.7.0.1
  • Exports23
  • LanguageHaskell2010
  • LicenceMIT
  • SourceDatatypes.hs

Constructors

14 declarations
valueconsOfHIT :: HasConstInfo m => QName -> m Bool
#

Is the datatype of this constructor a Higher Inductive Type? Precondition: The argument must refer to a constructor of a datatype or record.

valuegetFullyAppliedConType
  1. :: PureTCM m
  2. => ConHead

    Constructor.

  3. -> Type

    Reduced type of the fully applied constructor.

  4. -> m (Maybe ((QName, Type, Args), Type))

    Nothing if not data or record type.

    Just ((d, dt, pars), ct) otherwise, where d is the data or record type name, dt is the type of the data or record name, pars are the reconstructed parameters, ct is the type of the constructor instantiated to the parameters.

#

getFullyAppliedConType c t computes the constructor parameters from data type t and returns them plus the instantiated type of constructor c.

Nothing if t is not a data/record type or does not have a constructor c.

Precondition: t is reduced.

valuefullyApplyCon
  1. :: (PureTCM m, MonadBlock m, MonadTCError m)
  2. => ConHead

    Constructor.

  3. -> Elims

    Constructor arguments.

  4. -> Type

    Type of the constructor application.

  5. -> (QName -> Type -> Args -> Type -> Elims -> Telescope -> Type -> m a)

    Name of the data/record type, type of the data/record type, reconstructed parameters, type of the constructor (applied to parameters), full application arguments, types of missing arguments (already added to context), type of the full application.

  6. -> m a
#

Make sure a constructor is fully applied and infer the type of the constructor. Raises a type error if the constructor does not belong to the given type.

valuegetConType
  1. :: (PureTCM m, MonadBlock m)
  2. => ConHead

    Constructor.

  3. -> Type

    Ending in data/record type.

  4. -> m (Maybe ((QName, Type, Args), Type))

    Nothing if not ends in data or record type.

    Just ((d, dt, pars), ct) otherwise, where d is the data or record type name, dt is the type of the data or record name, pars are the reconstructed parameters, ct is the type of the constructor instantiated to the parameters.

#

getConType c t computes the constructor parameters from type t and returns them plus the instantiated type of constructor c. This works also if t is a function type ending in a data/record type; the term from which c comes need not be fully applied

Nothing if t is not a data/record type or does not have a constructor c.

Data types

9 declarations
valueisDatatype :: QName -> TCM Bool
#

Check if a name refers to a datatype or a record with a named constructor.