Syntax Lookup

Enter some language construct you want to know more about.
A record type is a named set of typed fields.

A record type defines a fixed structure with named fields.

Example

ReScriptJS Output
type myRecord = {
  name: string,
  age: int,
}

let myRecord: myRecord = {name: "Ada", age: 36}

let label = switch myRecord {
| {name, age} => name ++ " (" ++ Int.toString(age) ++ ")"
}

References