Commit | Line | Data |
---|---|---|
c0bdf964 SK |
1 | type unique |
2 | ||
3 | type t = | |
4 | | Unit | |
5 | | Nil | |
6 | | Int | |
7 | | String | |
8 | | Record of | |
9 | { unique : unique | |
523e2b06 | 10 | ; fields : record_fields |
c0bdf964 SK |
11 | } |
12 | | Array of | |
13 | { unique : unique | |
14 | ; ty : t | |
15 | } | |
16 | | Name of Tiger_symbol.t * t option ref | |
523e2b06 SK |
17 | and record_fields = |
18 | (Tiger_symbol.t * t) list | |
c0bdf964 SK |
19 | |
20 | type env = | |
21 | (Tiger_symbol.t, t ) Tiger_map.t | |
22 | ||
23 | val built_in : env | |
24 | ||
25 | val is_equal : t -> t -> bool | |
523e2b06 | 26 | |
c0bdf964 | 27 | val is_int : t -> bool |
523e2b06 SK |
28 | val is_string : t -> bool |
29 | val is_array : t -> bool | |
30 | val is_record : t -> bool | |
c0bdf964 SK |
31 | val is_name : t -> bool |
32 | ||
523e2b06 | 33 | val if_record : t -> f:(record_fields -> 'a) -> otherwise:(unit -> 'a) -> 'a |
161a300d | 34 | val if_array : t -> f:(t -> 'a) -> otherwise:(unit -> 'a) -> 'a |
523e2b06 SK |
35 | |
36 | val new_record : record_fields -> t | |
c0bdf964 SK |
37 | val new_array : t -> t |
38 | ||
39 | val to_string : t -> string |