-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlevel.mli
58 lines (42 loc) · 1.44 KB
/
level.mli
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
(** Precedence of operators *)
(** Levels of precedence -- higher level is less likely to be parenthesized. *)
type t
(** If we print [at_level] where [max_level] is the highest level that can still
be printed without parenthesis, should we print parenthesis? *)
val parenthesize : at_level:'a -> max_level:'a -> bool
(** Following OCaml syntax, there are five levels of infix operators *)
type infix = Infix0 | Infix1 | Infix2 | Infix3 | Infix4
(** The highest possible level *)
val highest : t
(** The least possible level *)
val least : t
(** The level which never gets parenthesized (equal to [least]) *)
val no_parens : t
(** The level of a prefix operator and its argument *)
val prefix : t
val prefix_arg : t
(** The level of application and its left and right arguments *)
val app : t
val app_left : t
val app_right : t
(** The level of an infix operator, and its left and right arguments *)
val infix : infix -> t * t * t
(** The level of an equality, and its arguments *)
val eq : t
val eq_left : t
val eq_right : t
(** The level of a binder (such as lambda) and its body *)
val binder : t
val in_binder : t
(** The elvel of an arrow and its arguments *)
val arr : t
val arr_left : t
val arr_right : t
(** The level of type ascription *)
val ascription : t
(** The level of a let binding *)
val let_binding : t
(** The level of the let-bound expression *)
val let_bound : t
(** The level of the body of a let-bound expression *)
val let_body : t