Syntax Lookup

Enter some language construct you want to know more about.
This is the dict{} syntax

Available in v12+

The dict{} syntax is used to represent dictionaries. It's used both when creating dicts, and when pattern matching on dicts.

Example

ReScriptJS Output
// Create a dict
let d = dict{"A": 5, "B": 6, "C": 7}

// Pattern match on the full dict
let b = switch d {
| dict{"B": b} => Some(b)
| _ => None
}

// Destructure the dict
let dict{"C": ?c} = d

References