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

Safe HaskellSafe
LanguageHaskell98

DDC.Source.Tetra.DataDef

Contents

Description

Source Tetra data type definitions.

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

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

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

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

Get the type of a data constructor.