Skip to content

Commit 3633487

Browse files
reid-spencerclaude
andcommitted
Distinguish simple vs parameterized predefined types on cheat sheet
The flat list was causing AI tools to use parameterized types like Currency without their required arguments. Now lists all simple predefined types separately from parameterized ones, with each parameterized type showing its required arguments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 87c5842 commit 3633487

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

docs/riddl/references/cheat-sheet.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,20 @@ messages, states, and parameters in RIDDL.
310310
- **Alternation** (union): `type X is one of { T1, T2, T3 }`
311311
- **Enumeration**: `type X is any of { A, B, C }`
312312
- **Collection**: `many T`, `set of T`, `mapping from K to V`, `T?`
313-
- **Pattern**: `Pattern("regex")`
314-
- **Predefined**: `String`, `Integer`, `Boolean`, `UUID`, `Date`,
315-
`DateTime`, `Duration`, `URL`, `Currency`, `Decimal`, etc.
313+
- **Simple predefined types** — use the name alone, no parameters:
314+
`Abstract`, `Nothing`, `Boolean`, `Current`, `Date`, `DateTime`,
315+
`Duration`, `Length`, `Luminosity`, `Mass`, `Mole`, `Number`,
316+
`String`, `Temperature`, `Time`, `TimeStamp`, `UUID`
317+
- **Parameterized predefined types****require parenthesized
318+
arguments**; using these without parameters is invalid:
319+
- `String(min, max, enc)` — constrained string
320+
- `Id(entity)` — unique identifier for an entity type
321+
- `URL(scheme)` — URL with a specific scheme
322+
- `Range(min, max)` — bounded integer range
323+
- `LatLong(lat, long)` — geographic coordinates
324+
- `Currency(country-code)` — monetary amount
325+
(e.g., `Currency(USD)`)
326+
- `Pattern(regex)` — string matching a regular expression
316327

317328
> *[For more details →](../concepts/type.md)*
318329

0 commit comments

Comments
 (0)