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

Safe HaskellSafe-Inferred

DDC.Source.Tetra.Module

Contents

Synopsis

Modules

data Module a n Source

Constructors

Module 

Fields

moduleName :: !ModuleName

Name of this module

moduleExportTypes :: [n]

Names of exported types (level-1).

moduleExportValues :: [n]

Names of exported values (level-0).

moduleImportModules :: [ModuleName]

Imported modules.

moduleImportTypes :: [(n, ImportSource n)]

Kinds of imported foreign types.

moduleImportValues :: [(n, ImportSource n)]

Types of imported foreign values.

moduleTops :: [Top a n]

Top-level things

Instances

Defix Module 
Expand Module 
(Show a, Show n) => Show (Module a n) 
(Pretty n, Eq n) => Pretty (Module a n) 
(NFData a, NFData n) => NFData (Module a n) 

isMainModule :: Module a n -> BoolSource

Check if this is the Main module.

data ExportSource n

Constructors

ExportSourceLocal

A name defined in this module, with an explicit type.

ExportSourceLocalNoType

A named defined in this module, without a type attached. We use this version for source language where we infer the type of the exported thing.

Instances

data ImportSource n

Source of some imported thing.

Constructors

ImportSourceAbstract

A type imported abstractly. It may be defined in a foreign language, but the Disciple program treats it abstractly.

ImportSourceModule

Something imported from a Disciple module that we compiled ourself.

ImportSourceSea

Something imported via the C calling convention.

Instances

Module Names

data QualName n

A fully qualified name, including the name of the module it is from.

Constructors

QualName ModuleName n 

Instances

Show n => Show (QualName n) 
NFData n => NFData (QualName n) 

data ModuleName

A hierarchical module name.

Constructors

ModuleName [String] 

isMainModuleName :: ModuleName -> Bool

Check whether this is the name of the "Main" module.

Top-level things

data Top a n Source

Constructors

TopBind a (Bind n) (Exp a n)

Top-level, possibly recursive binding.

TopData

Data type definition.

Fields

topAnnot :: a
 
topDataDef :: DataDef n
 

Instances

Defix Top 
Expand Top 
(Show a, Show n) => Show (Top a n) 
(Pretty n, Eq n) => Pretty (Top a n) 
(NFData a, NFData n) => NFData (Top a n) 

Data type definitions

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)