ReScript HomeReScript Home
DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact

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

  • Record

  • Pattern Matching

© 2026 The ReScript Project

About
  • Community
  • ReScript Association
Find us on