Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specification for type synonyms in DAML-LF #3635

Merged
merged 5 commits into from
Nov 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use S for type synonyms
  • Loading branch information
cocreature committed Nov 26, 2019
commit 00e1202b2afc964e56ad688e5e974ee027a1241e
10 changes: 5 additions & 5 deletions daml-lf/spec/daml-lf-1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ available for usage::
| 'variant' T (α₁: k₁)… (αₙ: kₙ) ↦ V₁ : τ₁ | … | Vₘ : τₘ
-- DefVariant
| 'enum' T ↦ E₁ | … | Eₘ -- DefEnum
| 'synonym' T (α₁: k₁)… (αₙ: kₙ) ↦ τ -- DefTypeSynonym
| 'synonym' S (α₁: k₁)… (αₙ: kₙ) ↦ τ -- DefTypeSynonym
| 'val' W : τ ↦ e -- DefValue
| 'tpl' (x : T) ↦ -- DefTemplate
{ 'precondition' e₁
Expand Down Expand Up @@ -852,11 +852,11 @@ First, we formally defined *well-formed types*. ::
————————————————————————————————————————————— TyTuple
Γ ⊢ ⟨ f₁: τ₁, …, fₙ: τₙ ⟩ : ⋆

'synonym' T (α₁:k₁) … (αₙ:kₙ) ↦ τ ∈ 〚Ξ〛Mod
'synonym' S (α₁:k₁) … (αₙ:kₙ) ↦ τ ∈ 〚Ξ〛Mod
(α₁:k₁) … (αₙ:kₙ) · Γ ⊢ τ : ⋆
Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da Nov 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(α₁:k₁) … (αₙ:kₙ) · Γ ⊢ τ : ⋆

This line would better go in Well-formed definitions paragraph.

    αₙ : kₙ · ⋯ · α₁ : k₁  ⊢  τ  :  ⋆
  ——————————————————————————————————————————————————————————————— DefSyn
    ⊢  'synonym' S (α₁: k₁) … (αₙ: kₙ) ↦ τ 

Γ ⊢ α₁ : k₁ … Γ ⊢ αₙ : kₙ
————————————————————————————————————————————— TyTypeSynonym
Γ ⊢ T α₁ … αₙ : ⋆
Γ ⊢ S α₁ … αₙ : ⋆



Expand Down Expand Up @@ -996,9 +996,9 @@ Then we define *well-formed expressions*. ::
——————————————————————————————————————————————————————————————— ExpEnumCon
Γ ⊢ Mod:T:Eᵢ : Mod:T

'synonym' T (α₁:k₁) … (αₙ:kₙ) ↦ τ Γ ↦ e : τ
'synonym' S (α₁:k₁) … (αₙ:kₙ) ↦ τ Γ ↦ e : τ
——————————————————————————————————————————————————————————————— ExpTypeSynonym
Γ ⊢ e : Mod:T α₁ … αₙ
Γ ⊢ e : Mod:S α₁ … αₙ

Γ ⊢ e₁ : τ₁ … Γ ⊢ eₘ : τₘ
——————————————————————————————————————————————————————————————— ExpTupleCon
Expand Down