free-compiler-0.3.0.0: A Haskell to Coq compiler.

Safe HaskellSafe
LanguageHaskell2010

FreeC.IR.Syntax.TypeDecl

Description

This module contains the definition of data type and type synonym declarations of our intermediate language.

Synopsis

Documentation

data TypeDecl Source #

A data type or type synonym declaration.

Instances
Eq TypeDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Show TypeDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Pretty TypeDecl Source #

Pretty instance for type declarations.

Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Methods

pretty :: TypeDecl -> Doc #

prettyList :: [TypeDecl] -> Doc #

HasDeclIdent TypeDecl Source #

Instance to get the name of a type synonym or data type declaration.

Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Similar TypeDecl Source #

Two type synonym declarations are similar if their right-hand sides are similar under an extended Renaming that maps the corresponding type arguments to each other.

     Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ τ ≈ τ'
——————————————————————————————————————————————
 Γ ⊢ type T α₁ … αₙ = τ ≈ type T β₁ … βₙ = τ'

Two data type declarations are similar if their constructors are pairwise similar under an extended Renaming that maps the corresponding type arguments to each other. Note that the order of the constructors in important.

 Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ con₁ ≈ con'₁, …,
 Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ conₘ ≈ con'ₘ
————————————————————————————————————————————————————————————————————————
 Γ ⊢ data D α₁ … αₙ = con₁ | … | conₘ
   ≈ data D β₁ … βₙ = con'₁ | … | con'ₘ
Instance details

Defined in FreeC.IR.Similar

Methods

similar' :: TypeDecl -> TypeDecl -> Renaming -> Bool

HasRefs TypeDecl Source #

Data type declarations refer to the types their constructors refer to and type synonym declarations refer to the types it's right-hand side refers to. Both don't refer to type variables that are bound by their type arguments.

Instance details

Defined in FreeC.IR.Reference

Methods

refSet :: TypeDecl -> RefSet

Parseable TypeDecl Source #

Data type and type synonym declarations can be parsed.

Instance details

Defined in FreeC.Frontend.IR.Parser

Methods

parseIR' :: Parser TypeDecl Source #

typeDeclQName :: TypeDecl -> QName Source #

Gets the qualified name of the given type declaration.

typeDeclName :: TypeDecl -> Name Source #

Gets the unqualified name of the given type declaration.

data ConDecl Source #

A constructor declaration.

Instances
Eq ConDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Show ConDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Pretty ConDecl Source #

Pretty instance for data constructor declarations.

Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Methods

pretty :: ConDecl -> Doc #

prettyList :: [ConDecl] -> Doc #

HasDeclIdent ConDecl Source #

Instance to get the name of a constructor declaration.

Instance details

Defined in FreeC.IR.Syntax.TypeDecl

Similar ConDecl Source #

Two constructor declarations are similar if their field types are similar.

 Γ ⊢ τ₁ ≈ τ'₁, …, Γ ⊢ τₙ ≈ τ'ₙ
———————————————————————————————
  Γ ⊢ C τ₁ … τₙ ≈ C τ'₁ … τ'ₙ
Instance details

Defined in FreeC.IR.Similar

Methods

similar' :: ConDecl -> ConDecl -> Renaming -> Bool

HasRefs ConDecl Source #

Constructor declarations refer to the types their field types refer to.

Instance details

Defined in FreeC.IR.Reference

Methods

refSet :: ConDecl -> RefSet

conDeclQName :: ConDecl -> QName Source #

Gets the qualified name of the given constructor declaration.

conDeclName :: ConDecl -> Name Source #

Gets the unqualified name of the given constructor declaration.