blob: 29f8a9abbe6e64d008d9a23dc02344c3a5d18f10 [file] [log] [blame]
-- frontmatter.toml --
title = "Disjunctions of Structs"
description = ""
-- text.md --
Disjunctions work for any type.
In this example we see that a `floor` of some specific house
has an exit on level 0 and 1, but not on any other floor.
-- sumstruct.cue --
// floor defines the specs of a floor in some house.
floor: {
level: int // the level on which this floor resides
hasExit: bool // is there a door to exit the house?
}
// constraints on the possible values of floor.
floor: {
level: 0 | 1
hasExit: true
} | {
level: -1 | 2 | 3
hasExit: false
}