Created
June 22, 2018 09:56
-
-
Save secondwtq/e7f410f08041c98041114990bc252a09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using _ = Music#Classical | |
# problem: Type vs. Entry | |
type HumanStatus = | |
| Active | |
| Deceased | |
# optional property should be allowed in entry & type | |
entry #Human { | |
name: string; | |
fullName: string; | |
born: Maybe date; | |
died: Maybe date; | |
status: HumanStatus; | |
} | |
entry _#Genre { | |
} | |
entry _#Composer is #Human { | |
} | |
link _#Composer _#writesGreat _#Genre; | |
type Catalog = | |
| Opus u32 | |
| Kochel u32 | |
entry _#Composition { | |
writtenBy: _#Composer; | |
catalog: Catalog; | |
} | |
link _#Composer _#wrote _#Composition; | |
let mozart = newEntity _# "mozart" { | |
name = "Mozart"; | |
fullName = "Wolfgang Amadeus Mozart"; | |
status = Deceased; | |
} | |
let k626 = newEntity _# "k626" { | |
catalog = Kochel 626 | |
} | |
newLink mozart _#wrote k626; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment