Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module contains the definition of data type and type synonym declarations of our intermediate language.
Synopsis
- data TypeDecl
- = DataDecl { }
- | TypeSynDecl { }
- typeDeclQName :: TypeDecl -> QName
- typeDeclName :: TypeDecl -> Name
- data ConDecl = ConDecl {}
- conDeclQName :: ConDecl -> QName
- conDeclName :: ConDecl -> Name
Documentation
A data type or type synonym declaration.
DataDecl | |
| |
TypeSynDecl | |
Instances
Eq TypeDecl Source # | |
Show TypeDecl Source # | |
Pretty TypeDecl Source # | Pretty instance for type declarations. |
Defined in FreeC.IR.Syntax.TypeDecl | |
HasDeclIdent TypeDecl Source # | Instance to get the name of a type synonym or data type declaration. |
Similar TypeDecl Source # | Two type synonym declarations are similar if their right-hand sides are
similar under an extended Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ τ ≈ τ' —————————————————————————————————————————————— Γ ⊢ type T α₁ … αₙ = τ ≈ type T β₁ … βₙ = τ' Two data type declarations are similar if their constructors are pairwise
similar under an extended Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ con₁ ≈ con'₁, …, Γ ∪ { α₁ ↦ β₁, …, αₙ ↦ βₙ } ⊢ conₘ ≈ con'ₘ ———————————————————————————————————————————————————————————————————————— Γ ⊢ data D α₁ … αₙ = con₁ | … | conₘ ≈ data D β₁ … βₙ = con'₁ | … | con'ₘ |
Defined in FreeC.IR.Similar | |
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. |
Defined in FreeC.IR.Reference | |
Parseable TypeDecl Source # | Data type and type synonym declarations can be parsed. |
Defined in FreeC.Frontend.IR.Parser |
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.
A constructor declaration.
ConDecl | |
|
Instances
Eq ConDecl Source # | |
Show ConDecl Source # | |
Pretty ConDecl Source # | Pretty instance for data constructor declarations. |
Defined in FreeC.IR.Syntax.TypeDecl | |
HasDeclIdent ConDecl Source # | Instance to get the name of a constructor declaration. |
Similar ConDecl Source # | Two constructor declarations are similar if their field types are similar. Γ ⊢ τ₁ ≈ τ'₁, …, Γ ⊢ τₙ ≈ τ'ₙ ——————————————————————————————— Γ ⊢ C τ₁ … τₙ ≈ C τ'₁ … τ'ₙ |
Defined in FreeC.IR.Similar | |
HasRefs ConDecl Source # | Constructor declarations refer to the types their field types refer to. |
Defined in FreeC.IR.Reference |
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.