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.
This is the and keyword for mutually recursive definitions.

Use and to define multiple items in one mutually-recursive group.

Example 1: let rec ... and ...

ReScriptJS Output
let rec isEven = n => n == 0 || isOdd(n - 1)
and isOdd = n => n != 0 && isEven(n - 1)

Example 2: type rec ... and ...

ReScriptJS Output
type rec expr = Add(expr, term) | Term(term)
and term = Int(int)

References

  • Recursive Functions

  • Type

© 2026 The ReScript Project

About
  • Community
  • ReScript Association
Find us on