Contents

Language reference (mere)

The syntax and semantics of Mere as currently implemented (as of 2026-06-24 / Phase 46). &T references / region / view / effects / FFI / 4-backend codegen are all implemented. Phase 36 added 13 kinds of syntactic sugar (range / op section / :: / <| / @@ / \ lambda / string interp / ? / ?! / list comp / if let / for-in-do / while-do), substantially improving ergonomics in the ML-family tradition.


1. Lexical

Comments


// Line comment (to end of line)

Literals

KindExample
Integer0, 42, -5 (syntactically Neg (Int_lit 5))
Float1.5, 3.14, 0.0, 1e3, 2.5e-8, 4E+5 (digits.digits, or an exponent; bare 1. is not a float)
Booleantrue, false
String"hello"; escapes are \n \t \\ \"
Char (length-1 str)'X'; escapes are '\n' '\t' '\\' '\'' '\"'
Unit()

A char literal 'X' is just a length-1 str (Mere has no separate char type). Convenient for dispatch like match c with | 'n' -> .... To avoid ambiguity with the type variable syntax ('a opt etc.), the lexer distinguishes 'X' (closing quote present) from 'NAME (no closing quote; alphabetic start).

Identifiers

Keywords


let rec and in if then else true false fn type signature
match with when of as _ for do while
module open import extern using region view drop
trait impl dyn derive

None of these can be a name; let view = 5 is refused with "view is a reserved word". The list is the lexer's own table, and scripts/keywords_doc_check.sh holds this block and reserved-names.md to it.

Operators and symbols


+ - * / %                arithmetic
== != < <= > >=          comparisons
&& ||                    logic (short-circuit)
++                       string concatenation
|> << >>                 pipe / function composition
<|                       reverse pipe (Phase 36): f <| x = f x
@@                       low-precedence apply (Phase 36): f @@ x = f x
::                       cons operator (Phase 36): h :: t = Cons (h, t)
..                       range literal (Phase 36): a..b = [a, ..., b-1]
?                        Option early return (Phase 36)
?!                       Result early return (Phase 36)
<-                       list comprehension generator (Phase 36)
\                        lambda shorthand (Phase 36): \x -> e
->                       function type / match-arm separator
=                        binding
: ; , .                  annotation / terminator / separator / field
( ) { } [ ]              grouping
...                      signature spread / list tail
|                        match separator / variant separator / record update / list comp

String interpolation (Phase 36)

Inside string literals, {expr} is interpolation: the lexer tokenizes recursively, and the parser expands "a {x} b" into something like "a " ++ show_or_str x ++ " b" (actually a ++ chain depending on expr's type). \{ escapes a literal brace; nested string literals inside the interpolation are forbidden (work around by binding via let first).


let n = 42 in print "answer = {show n}"        // "answer = 42"
print "escape: \{not interpolated\}"            // "escape: {not interpolated}"

2. Types

Primitives


int   float   bool   str   unit

float is IEEE 754 double. Literals with a decimal point and digits (e.g. 1.5) are float, and so is anything with an exponent — 1e3, 2.5e-8, 4E+5 — which is how the ends of the double range are written (1.7976931348623157e308). A digit must follow the e, so 1.5 e is still a float applied to a variable named e. 1 is int (bare 1. is not float but 1 + a potential .field). int and float are distinct types with no implicit coercion — use float_of_int / int_of_float explicitly; arithmetic uses f_add / f_sub / f_mul / f_div.

Composite types


t1 -> t2         function type (right-assoc: a -> b -> c == a -> (b -> c))
t1 * t2 * ...    tuple type
t list           type constructor (postfix application)
(t1, t2) result  multi type-arg
'a               type parameter (in declaration / annotation)
&R t             region-tagged reference type (Phase 1: syntax only; semantic checks come later)

3. Expressions

Literals / identifiers


42   true   "hi"   ()
x    (variable reference)

Arithmetic / comparison / logic


1 + 2 * 3                7         (* / has higher precedence)
10 / 3                   3         (integer division; 0 div is Eval_error)
10 % 3                   1         (mod; 0 div is Eval_error)
"a" ++ "b"               "ab"      (string concat)
5 <= 5                   true
1 != 2                   true
true && false            false     (short-circuit: don't eval RHS if LHS is false)
false || true            true
not true                 false     (builtin)

Phase 36 syntactic sugar at a glance

All desugar at the parser or lexer level, so the AST and beyond are unaffected. Per-form precedence is in §6.


0..5                     // range: [0, 1, 2, 3, 4] (parser directly generates this; effectively list_iota)
1 :: 2 :: []             // cons: Cons (1, Cons (2, Nil))
(+ 1)                    // op section: fn x -> x + 1
(* 2)                    // (- 1) is ambiguous with unary -, so parenthesize
(< 10)                   // comparison sections also work
\x -> x + 1              // lambda shorthand: = fn x -> x + 1
\(a, b) -> a + b         // tuple destructure OK
f <| x                   // reverse pipe: = f x
f @@ x                   // low-precedence apply: = f x; readable across line breaks
"x = {show n}"           // string interpolation (lexer level; see §1)

[expr | x <- xs, p x]                       // list comprehension (single gen + filter)
[expr | x <- xs, y <- ys, p x y]            // multi-generator (cartesian)
                                            // desugar: list_map / list_flat_map

if let pat = e then yes_branch else no_branch
  // = match e with | pat -> yes_branch | _ -> no_branch
  // (else is required; both branches share the same type)

for x in xs do body                         // = list_iter xs (\x -> body)
                                            // body must be unit-typed
while cond do body                          // = let rec __while_N = fn () ->
                                            //     if cond then (body; __while_N ()) else () in
                                            //   __while_N ()
                                            // Note: currently only runs inside an fn body (top-level is codegen-unsupported)

Option / Result early-return (? / ?!, Phase 36)

let pat = e? in body form:

Both desugar to Match in the parser:


let v = parse_int s ? in body
  ≈ match parse_int s with | Some v -> body | None -> None

let bindings


let x = 5 in x + 1                 // ident
let _ = side_effect in 1           // wildcard
let (a, b) = (3, 4) in a + b       // tuple destructure
let (a, (b, c)) = (1, (2, 3)) in a + b + c

let rec / mutual recursion


let rec fact = fn n -> if n < 1 then 1 else n * fact (n - 1) in fact 5

let rec is_even = fn n -> if n == 0 then true else is_odd (n - 1)
and is_odd     = fn n -> if n == 0 then false else is_even (n - 1)
in is_even 10

Top-level functions in any order (v0.1.588)

A top-level function may call one defined below it, and two top-level functions may call each other from separate declarations -- no and needed:


let area = fn (s: Shape) -> scale * base_area s;
let scale = 2;
let base_area = fn (s: Shape) -> match s with | Sq n -> n * n | Dot -> 0;

let is_even = fn (n: int) -> if n == 0 then true else is_odd (n - 1);
let is_odd  = fn (n: int) -> if n == 0 then false else is_even (n - 1);

What runs still runs in the order it is written: a value (let t = map_new ();, let _ = print "hi";) keeps its place relative to every other value. Only function definitions -- which do nothing when they are reached -- are placed after what they refer to, and functions that refer to each other across declarations are checked as one group (so they are monomorphic in each other, the way an and group is). A value still cannot use something defined below it: let v = f 1; above the definition of a function f needs is the unbound variable error it always was. Inside an expression, let ... in keeps its order.

Forward declarations (let fn <name>: <type>;)

let rec ... and ... is the way two definitions inside an expression can call each other, and a chain closes where it ends. import is a splice, so a chain also closes at an import: two files, or two chains in one file, could not be mutually recursive. A forward declaration binds a name to a written type at the point of the promise; the definition follows anywhere below, including in a file imported further down.


let fn is_even: int -> bool;                    // the promise
let is_odd  = fn (n: int) -> if n == 0 then false else is_even (n - 1);
let is_even = fn (n: int) -> if n == 0 then true  else is_odd  (n - 1);

It is the mirror of extern fn <name>: <type>;, which declares a name defined outside Mere; this one is defined inside it, later. Two rules, both checked:

above the definition and callers written below it would see different types for the same name;

refused, naming the declaration.

A written type variable is quantified, not rigid: let fn idl: 'a list -> 'a list; declares a scheme, and each call site instantiates it fresh. (In a parameter annotation the same 'a still names one type the caller chose — there the writer is naming, here promising.) Region parameters make this the ordinary case rather than the exotic one: every function that takes a Map or a Vec has one.

The definition must be at least as general as the declaration, not merely an instance of it — let fn idl: 'a list -> 'a list; with let idl = fn (xs: int list) -> xs; is refused. It has to be: a caller written above the definition would otherwise be free to pass a str list, which is the one thing a declaration exists to allow and the definition cannot do.

A declaration also does not cost the name any polymorphism it would have had: a declared 'a -> 'a is usable at as many types as the same definition with no declaration at all.

The name may be module-qualified — let fn M.f: int -> int; declares a member of module M { ... }, whose splice gives it that name.

mere --decls <file>

Prints the declaration for every top-level name the file defines — how a large chain gets split without transcribing hundreds of types by hand. It reports the file's own names only (not the prelude's), under the spellings the source uses, and does not run the program.

Two kinds of name come out commented, with the reason, because pasting them back would not mean what it says:

one declaration cannot name two bindings;

written above let show = ... uses the builtin show; a declaration puts the user's show in scope from the declaration down, which changes what that caller calls. Uncomment it only if that is what you want.

scripts/decls_roundtrip.sh is the gate: every program in test/parity/ must produce identical output with its own --decls output prepended.

⚠ A record type declared inside a module cannot be named in an annotation from outside it — M.t and t are both rejected — so a declaration mentioning one does not type-check. That is a pre-existing gap in annotations generally, not in declarations: let use = fn (r: M.t) -> r.a fails the same way.

if-then-else / if-then


if cond then a else b               // standard if; a and b share the same type
if cond then print "msg"            // side-effect-only; body must be unit-typed

with (scope-bound resources with Drop, Phase 3.1)

with c = v in body is for resources with Drop (DB connections / file handles / mutexes etc.). The bound value's type must be a drop type ...-declared Drop type (use let for Trivial values). At scope end, the value's close: unit -> unit field is invoked (no-op if absent). Multiple bindings close in LIFO order.


drop type Conn = { id: int, close: unit -> unit };
let mk_conn = fn id ->
  Conn { id = id, close = fn () -> print ("close " ++ show id) };

with c = mk_conn 1 in c.id
// Result: 1. At scope end, "close 1" is printed.

with c1 = mk_conn 1, c2 = mk_conn 2 in c1.id + c2.id
// Result: 3. Prints "close 2" → "close 1" (LIFO).

with x = 5 in x + 1    // ERROR: int isn't a Drop type. Use `let`.

Design notes: implements option (i) from the internal design notes — "region is strict-Trivial; Drop is managed via with".

region (Phase 2: syntax + value expression &R v + escape check)

See memory-model.md for the memory-management concepts, comparisons, and Mere's overall strategy.


region R { body }                   // bring R into scope as a region name; evaluate body
region R { region S { ... } }       // nesting OK

fn (x: &R int) -> x                  // `&R T` reference type (R is a region name)
&R 5                                 // value expression: tag 5 as `&R int`
let x: &R int = &R 5 in ...          // combined with explicit annotation

Current semantics (Phase 2):

Escape check examples:


region R { 42 }                      // OK: int doesn't contain R
region R { let x = &R 5 in 42 }      // OK: `&R int` used inside, but result is int
region R { &R 5 }                    // ERROR: result is `&R int`; R leaks out
region R { (&R 1, 2) }               // ERROR: `&R int` inside a tuple

`R.alloc(v)` sugar (Phase 2.5): inside a region, R.alloc(expr) is syntactic sugar for &R expr. The desugaring only happens when R is a lexically enclosing region name (ordinary obj.alloc(...) field accesses keep working).


region R {
  let x = R.alloc(5) in              // == let x = &R 5 in ...
  let p = R.alloc((1, 2)) in
  42
}

`Trivial[R]` constraint (Phase 2.6): only types without Drop semantics (Trivial) can be placed in a region. Drop types are declared with drop type Name = ...; including such a type in a region (&R v / R.alloc(v) / view fields) is a type error. This is "a constraint that allows bulk region freeing"; caps that need Drop (DB connections / file handles etc.) are separately managed by a future with expression.


drop type Conn = { id: int };

let c = Conn { id = 1 } in c.id      // OK: Drop types are usable outside a region

region R {
  &R Conn { id = 1 }                  // ERROR: Trivial[R] violated
}

view Holder[R] { c: Conn };
region S { Holder { c = ... } }       // ERROR: view field has a Drop type

region R {
  &R (fn (c: Conn) -> c.id)           // OK: function types are Trivial (closure values)
}

`Trivial[R]` is implicitly the default: ordinary types (int / str / record / tuple / variant / Vec[R, T] / &R T / closure etc.) are automatically `Trivial[R]`. Users do not need to declare impl Trivial[R] for X { } (a future trait system may revisit this; see the internal design notes §3). The sole exception is types declared with drop type — they break Trivial[R] at every position they structurally appear (contains_drop_type walker in lib/typer.ml). So the judgment scheme is the simple "default-Trivial + drop-blacklist". Full trait-system rollout (DEFERRED §3.1) and explicit impl Trivial[R] syntax (§6.1) are linked in the design but don't affect the current implementation.

view (Phase 2.4: declaration + region enforcement + type-tag propagation)


view V[R] of T { f1: T1, f2: T2, ... };   // view type over region R (with explicit inner type T)
view V[R] { f1: T1, ... };                // `of T` is optional

view V[R] of T { ... } is a data declaration with a region parameter. In Phase 2.4:


view Node[R] of int { value: int, next: int };
region R { let n = Node { value = 1, next = 0 } in n.value }       // 1
region MyArena { let n = Node { value = 7, next = 0 } in n.value } // 7 (R → MyArena)
let n = Node { value = 1, next = 0 } in ...                        // ERROR: must be inside a region block

view Slot[R] { item: &R int };
region S { 
  let s = Slot { item = &S 42 } in     // s : Slot[S]
  let take_s = fn (x: &S int) -> 99 in
  take_s s.item                         // s.item : &S int → 99
}

region S { Slot { item = &T 42 } }     // ERROR (region mismatch)
region S { Cell { v = 1 } }            // ERROR: Cell[S] cannot leave region S

Planned tightening for later phases:

See memory-model.md and the internal design notes.

Functions + using [cap] syntactic sugar

using [cap1, cap2, ...] is a sugar that eases the repeated partial-application patterns of cap-passing style. Caps are expanded as the outermost curried args.


fn x using [logger] -> body
// ≡ fn logger -> fn x -> body

Callers can immediately get a T -> U with the cap embedded via f cap, ready to pass to higher-order functions like map:


let log_x = fn x using [logger] -> logger (show x);
let bound = log_x my_logger;    // bound : int -> unit
iter bound [1, 2, 3];

Functions


fn x -> x + 1                       // single arg (type-inferred)
fn (x: int) -> x + 1                // single arg (annotated)
fn (x: int, y: int) -> x + y        // multi-arg (desugared to currying)
fn (a, b, c) -> a + b * c           // multi-arg, no annotations
fn () -> 42                         // no args (internally _u : unit)

Application / partial application


inc 5
add 3 4                             // = (add 3) 4
let inc1 = (+) 1 in ...             // turning operators into functions is not yet supported (use a curried fn)

Tuples / records / lists


(1, 2, 3)                           // tuple

type Point = { x: int, y: int };
let p = Point { x = 3, y = 4 } in p.x + p.y           // record
let p2 = { p | x = 100 } in p2.x                       // record update

type 'a list = Nil | Cons of 'a * 'a list;
[1, 2, 3]                           // list literal sugar = Cons (1, Cons (2, Cons (3, Nil)))
[1, 2, 3,]                          // trailing comma allowed (also in tuple / record literals)
[]                                  // = Nil

Sum types / constructors / match


type 'a opt = None | Some of 'a;

match Some 42 with
| None -> 0
| Some n when n > 10 -> 1000
| Some n -> n + 1

match xs with
| []          -> "empty"
| [h, ...t]   -> "head + rest"
| [a, b, c]   -> "exactly three"

match x with
| (a, b) as p when a < b -> p         // as-pattern: bind whole to p
| _                      -> (0, 0)

match day with
| 1 | 2 | 3 | 4 | 5 -> "weekday"     // or-pattern
| 6 | 7             -> "weekend"
| _                 -> "invalid"

Block / side-effect sequencing


{ }                                 // → unit
{ e1; e2; e3 }                      // → eN; e1..e_(N-1) are discarded (sugar for let _ = ... in chains)

Function composition / pipe


5 |> inc |> dbl                     // = dbl (inc 5); left-assoc; lowest precedence
inc << dbl                          // = fn x -> inc (dbl x); right-assoc
inc >> dbl                          // = fn x -> dbl (inc x); right-assoc

Type annotation


(42 : int)                          // expressive; must agree with the existing type
((fn x -> x + 1) : int -> int) 5    // function-typed annotation

Signature alias (function-argument bundling)


signature ctx = (db: int, log: int);

let save = fn (...ctx, order: int) -> db + log + order in
save 100 10 5                       // 115

4. Patterns

String prefix patterns (v0.1.504)


match url with
| "https://" <> rest -> secure rest
| "http://" <> rest -> plain rest
| "mailto:" <> _ -> mail
| other -> none other

The scrutinee starts with the literal, and what is left is bound (_ discards it). The literal's length is counted in code points, not bytes: "ét" <> rest on "été" binds "é", where the prefix is two characters and three bytes.

Lowered before inference into the guard and the slice the same code was writing by hand — str_starts_with, then utf8_sub — so no backend knows the syntax exists. Two consequences worth knowing:

guarded arm closes nothing, so a match on str still wants a catch-all.

because the binding is made for the guard as well as for the body.

⚠ utf8_sub walks the string. That is right for parsing and wrong for a hot loop; a byte-indexed slice would be a builtin on five backends, and waits for something measured to ask for it.

KindSyntaxExample
Wildcard__
Variablenamen, xs
IntegerN0, 42
Booleantrue / false
String"...""foo"
Unit()
Tuple(p1, p2, ...)(a, b), (a, (b, c))
ConstructorName or Name sub_patNone, Some x, Cons (h, t)
List[] / [a, b, c] / [h, ...t] / [..._]
RecordName { f1 = p1, f2 = p2 }Point { x = 0, y = py }; partial OK
aspat as nameCons (h, t) as whole
orp1p2123; both branches bind the same names + types

Guards (in match)


match x with
| n when n > 0 -> "positive"
| _            -> "non-positive"

5. Top-level declarations

let / let rec


let x = 5;                          // ident form
let (a, b) = (3, 4);                // pattern form
let _ = print "init";               // wildcard is fine

let rec fact = fn n -> ... ;
let rec is_even = ... and is_odd = ... ;

Type declarations


// 1. Sum type (variant)
type 'a opt = None | Some of 'a;
type ('a, 'b) result = Ok of 'a | Err of 'b;

// 2. Record
type Point = { x: int, y: int };
type 'a Box = { value: 'a };

// 3. Type alias
type UserId = int;
type Pair = int * int;
type 'a Stack = 'a list;

Disambiguation:

signature


signature ctx = (db: int, log: int);
// Expanded by `fn (...ctx, x: int) -> ...` (parse-time)

6. Operator precedence (low → high)

PrecedenceOperatorsAssociativity
1 (low)let, if, fn, match, with, for, while-
2@@ (low-precedence apply, Phase 36)right
3> / < (Phase 36)left / right
4<<, >>right
5left
6&&left
7==, !=, <, <=, >, >=non-associative
8:: (cons, Phase 36)right
9.. (range, Phase 36)non-associative
10+, -, ++left
11*, /, %left
12unary --
13? / ?! (postfix, Phase 36)postfix
14function applicationleft
15 (high)atom / (...) / [...] / {...} / .field / op section (+ N) / \x -> e / "...{expr}..."-

expr : type (annotation) is applied once at the outermost level.


7. Evaluation model

Copy semantics (implicitly default)

Mere has no explicit "copyable" marker like Rust's Copy trait. Instead, the following implicit rules:

So Mere's Copy/Linear distinction is realized via three layers — Drop types / OwnedVec / everything else — without explicit Copy/Linear trait annotations. Design room remains to introduce T: Copy / T: Linear type bounds later (linked to the trait system §3.1), but with no dogfood signal, it's confirmed-deferred (same §6.4).


8. Known constraints (2026-06-24)

Items previously listed as "not implemented" were implemented incrementally through Phases 14-36; the following remain:

8.5. pub inside a module (v0.1.504)


module Store {
  let secret_key = fn (n: int) -> n * 7;   // internal
  pub let get = fn (n: int) -> secret_key n + 1;
}
print_int (Store.get 5)        // fine
print_int (Store.secret_key 5) // type error: `Store.secret_key` is internal to module `Store`

Opt-in per module. A module that marks nothing exports everything, exactly as every module written before this does; a module that marks anything is saying it has decided what its surface is, and its unmarked members become internal. Members of the module — and of modules nested inside it — reach each other regardless.

pub is not a keyword: it is an identifier the module-body parser recognises in front of let, so a program using pub as a name is unaffected.

And at the top of a FILE (v0.1.514, Q-166). import "path"; splices the imported file's declarations into this one's, so after an import there is a single top-level namespace — which is why this entry used to say file-level visibility had "nothing to enforce". The boundary the splice erases is the one Loc.t keeps: every token carries the file it came from, so a reference can be checked against the file that made the binding.


// lib.mere
let internal_helper = fn (n: int) -> n * 7;
pub let public_api = fn (n: int) -> internal_helper n + 1;

import "lib.mere";
print_int (public_api 6)     // 43
print_int (internal_helper 6) // type error: `internal_helper` is internal to lib.mere

Opt-in per file, as it is per module: a file that marks nothing exports everything, which is every file written before this one. A file that binds the name itself is unaffected by what another file decided about its own copy — the single namespace means two files may bind the same top-level name, and without that rule one library marking pub would make a common name unusable everywhere.

⚠ This is visibility, not separate compilation. The splice still happens: the program is still one translation unit, mere -c still reads the whole tree, and pub changes what may be REFERRED to rather than what is compiled.


9. What the compiler warns about

A warning is not an error: the program compiles and runs. Every one of these is something the compiler knows and the person cannot see.

warningwhat it means
a type name collides with a C type, keyword or libc symbolthe C backend will refuse this later, with an error about generated code rather than about your line (reserved-names.md). A let name cannot collide: every backend prefixes it
extern fn declares a different arity than the compiler implementsthe same, one layer down
main is not special in Merethe entry point is the file's trailing expression; a binding named main reads as if it were one
non-exhaustive match with no wildcard for an unenumerable typean approximation the checker cannot prove; a named missing case is an error, not a warning
an arm no value can reachan earlier arm already answers it
an unread binding (v0.1.503)a local let or a match binder that nothing reads. Prefix it with _ if that is deliberate. Not reported for top-level names (a file that is imported has its readers elsewhere), for function parameters, or for any file that did not type-check — in a half-inferred tree "nothing reads this" is usually "the line that reads it is the one being typed"
a `let` that can fail (v0.1.505)an ERROR, not a warning: let Some n = e; is a match with one arm, and the value it does not handle is named. let (a, b) = ..., a record pattern and a constructor pattern on a one-constructor type are all total and stay free. if let is untouched — it is the construct for a pattern that may not match
a deprecated name (v0.1.503)one of the compiler's own names that has been retired, with the replacement. Only where the name resolves to the builtin: a binding of your own by that name is yours

--warnings-as-errors makes a run that produced any of these exit 1 — everything is still printed and still emitted, and the status is the answer. It counts warnings PRODUCED, not the ten a terminal prints.

A terminal prints at most ten warning blocks and then says how many more there are; an editor draws all of them.

Where a diagnostic points (v0.1.506): at the line you can act on. A failure raised inside a prelude function — assert, divmod, list_max are written in Mere — reports the call in your file rather than the prelude's own line, and declaring a type twice puts the caret on the second declaration while the message names the first. (The first tree the unread-binding check was pointed at answered with 462, which is four thousand lines of stderr in front of whatever you ran the compiler to see.)

When the spelling is another language's (v0.1.507): the error says what to write instead. This is the layer you meet first, and until now it was the only one with no help: lines of its own — var x = 1; and def f(n): both came back as trailing input.


parse error: expected ';' or 'in' after let binding
  --> x.mere:1:35
  |
1 | let _ = if true then 1 elif false then 2 else 3;
  |                                   ^^^^
  |
  = help: `elif` — chain with `else if`
you wroteMere
x += 1bindings do not change: let y = x + 1;
#comments are //
!xnegation is not x — != is the comparison
$ outside a stringinterpolation is "x = {expr}", so $ never starts anything
=>the arrow is ->
{ ... } as a blockif c then a else b, match x with \pat -> e; a sequence is let _ = a; b
= as a comparison==
mut / var / vallet name = value;
def / func / funlet name = fn (x: int) -> body;
case / switchmatch x with \pat -> e
elifelse if
returnthe last expression is the value
a and ba && b — and joins a let rec ... and ... group
a leading ;; ends a let or a declaration; it cannot begin one

A hint names the token it keyed on, and a word you BIND is yours: var, case, val and mut are ordinary identifiers, and a file that binds one is never told about another language. (of is not in the table at all — it is Mere's own keyword in type t = A | B of int.)


10. Status summary


For detailed behavior, see examples/ and test/test_basic.ml.