-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathident.sml
72 lines (53 loc) · 1.36 KB
/
ident.sml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
local
signature IDENT = sig
type t
val eq : t * t -> bool
val compare : t * t -> order
structure Map : MAP where type key = t
val from_string : string -> t
val get_name : t -> string
end
functor Ident (X : sig end) :> IDENT = struct
type t = string
val eq = op=
val compare = String.compare
structure Map = BinarySearchMap struct
type t = t
val compare = compare
end
fun from_string s = s
fun get_name s = s
end
in
structure ValID = Ident ()
structure TypeID = Ident ()
structure ModuleID = Ident ()
structure SignatureID = Ident ()
structure ConstrID = Ident ()
type val_ident = ValID.t
type type_ident = TypeID.t
type module_ident = ModuleID.t
type signature_ident = SignatureID.t
type constr_ident = ConstrID.t
type location = module_ident list * type_ident
structure TypeVar :> sig
type t
val from_string : string -> t
val compare : t * t -> order
val get_name : t -> string
val show : t -> string
structure Map : MAP where type key = t
end = struct
type t = string
fun from_string s = s
val compare = String.compare
fun get_name s = s
fun show s = "'" ^ s
structure Map = BinarySearchMap struct
type t = t
val compare = compare
end
end
type type_var = TypeVar.t
type type_vars = type_var list
end