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

Safe HaskellNone

Agda.TypeChecking.Datatypes

Contents

Synopsis

Constructors

getConHead :: QName -> TCM ConHeadSource

Get true constructor with record fields.

getConTerm :: QName -> TCM TermSource

Get true constructor as term.

getConForm :: QName -> TCM ConHeadSource

Get true constructor with fields, expanding literals to constructors if possible.

getOrigConHead :: QName -> TCM ConHeadSource

Augment constructor with record fields (preserve constructor name). The true constructor might only surface via reduce.

getConstructorData :: HasConstInfo m => QName -> m QNameSource

Get the name of the datatype constructed by a given constructor. Precondition: The argument must refer to a constructor

getConType :: ConHead -> Type -> TCM (Maybe Type)Source

getConType c t computes the constructor parameters from type t and returns 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.

getConstructorArity :: QName -> TCM (Either Nat [Arg QName])Source

Return the number of non-parameter arguments to a data constructor, or the field names of a record constructor.

For getting just the arity of constructor c, use either id size $ getConstructorArity c.

Data types

isDatatype :: QName -> TCM BoolSource

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

data DataOrRecord Source

Constructors

IsData 
IsRecord 

Instances

isDataOrRecordType :: QName -> TCM (Maybe DataOrRecord)Source

Check if a name refers to a datatype or a record.