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