You are currently looking at the v6.0 - v8.2 docs (Reason v3.6 syntax edition). You can find the latest manual page here.

(These docs are equivalent to the old BuckleScript docs before the ReScript rebrand)

Try via CLI

You can compile a file directly via bsc MyFile.re (or bsc MyFile.ml):

Reason (Old Syntax)ML (Older Syntax)
// MyFile.re
let rec fib = n => {
  switch (n) {
  | 0 | 1 => n
  | n => fib(n - 1) + fib(n - 2)
  }
};
Js.log(fib(0));
SH
❯ bsc MyFile.re // Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE 'use strict'; function fib(n) { if (n === 0 || n === 1) { return 1; } else { return fib(n - 1 | 0) + fib(n - 2 | 0) | 0; } } console.log(fib(0)); exports.fib = fib; /* Not a pure module */

You can also get the inferred signature directly via bsc -i MyFile.re

Reason (Old Syntax)ML (Older Syntax)
let fib: int => int;