1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[@@@ocaml.text "/*"]
(** Copyright 2021-2026, Kakadu and contributors *)
(** SPDX-License-Identifier: LGPL-3.0-or-later *)
[@@@ocaml.text "/*"]
type flag = Ast.flag =
| Rec
| Nonrec
[@@deriving show { with_path = false }]
type bop = Ast.bop =
| Plus
| Minus
| Times
| Divide
| Eq
| Neq
| Lt
| Gt
| Le
| Ge
[@@deriving show { with_path = false }]
type 'name t = 'name Ast.t =
| Int of int
| Var of 'name
| Abs of 'name * 'name t
| App of 'name t * 'name t
| Binop of bop * 'name t * 'name t
| Neg of 'name t
| If of 'name t * 'name t * 'name t
| Let of flag * 'name * 'name t * 'name t
[@@deriving show { with_path = false }]
let pp_named = pp Format.pp_print_string