Agda-2.3.0: A dependently typed functional programming language and proof assistant

Agda.TypeChecking.Rules.Data

Contents

Synopsis

Datatypes

checkDataDef :: DefInfo -> QName -> [LamBinding] -> [Constructor] -> TCM ()

Type check a datatype definition. Assumes that the type has already been checked.

checkConstructor :: QName -> Telescope -> Nat -> Sort -> Constructor -> TCM ()

Type check a constructor declaration. Checks that the constructor targets the datatype and that it fits inside the declared sort.

bindParameters :: [LamBinding] -> Type -> (Telescope -> Type -> TCM a) -> TCM a

Bind the parameters of a datatype.

fitsIn :: Type -> Sort -> TCM ()

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

constructs :: Int -> Type -> QName -> TCM ()

Check that a type constructs something of the given datatype. The first argument is the number of parameters to the datatype. TODO: what if there's a meta here?

forceData :: QName -> Type -> TCM Type

Force a type to be a specific datatype.

isCoinductive :: Type -> TCM (Maybe Bool)

Is the type coinductive? Returns Nothing if the answer cannot be determined.