ddc-source-tetra-0.4.1.3: Disciplined Disciple Compiler source language.

Safe HaskellSafe-Inferred

DDC.Source.Tetra.DataDef

Contents

Synopsis

Data Type Definition.

data DataDef n Source

Data type definitions.

Constructors

DataDef 

Fields

dataDefTypeName :: !n

Data type name.

dataDefParams :: [Bind n]

Type parameters.

dataDefCtors :: [DataCtor n]

Parameters and return type of each constructor.

Instances

Show n => Show (DataDef n) 
NFData (DataDef n) 

typeEnvOfDataDef :: Ord n => DataDef n -> TypeEnv nSource

Take the types of data constructors from a data type definition.

Data Constructor Definition.

data DataCtor n Source

A data type constructor definition.

Constructors

DataCtor 

Fields

dataCtorName :: !n

Name of the data constructor.

dataCtorFieldTypes :: ![Type n]

Types of each of the fields of the constructor.

dataCtorResultType :: !(Type n)

Result type of the constructor.

Instances

Show n => Show (DataCtor n) 
NFData (DataCtor n) 

typeOfDataCtor :: DataDef n -> DataCtor n -> Type nSource

Get the type of a data constructor.