Switch Type.unique implementation from ref to Symbol
[tiger.ml.git] / compiler / src / lib / tiger / tiger_env_type.mli
1 module Sym = Tiger_symbol
2
3 type unique
4
5 type t =
6 | Unit
7 | Nil
8 | Int
9 | String
10 | Record of
11 { unique : unique
12 ; fields : record_fields
13 }
14 | Array of
15 { unique : unique
16 ; ty : t
17 }
18 | Name of Sym.t * t option ref
19 and record_fields =
20 (Sym.t * t) list
21
22 type env =
23 (Sym.t, t ) Tiger_map.t
24
25 val built_in : env
26
27 val is_equal : t -> t -> bool
28
29 val is_int : t -> bool
30 val is_string : t -> bool
31 val is_array : t -> bool
32 val is_record : t -> bool
33 val is_name : t -> bool
34
35 val if_record : t -> f:(record_fields -> 'a) -> otherwise:(unit -> 'a) -> 'a
36 val if_array : t -> f:(t -> 'a) -> otherwise:(unit -> 'a) -> 'a
37
38 val new_record : name:Sym.t -> fields:record_fields -> t
39 val new_array : name:Sym.t -> ty:t -> t
40
41 val to_string : t -> string
This page took 0.063287 seconds and 4 git commands to generate.