summaryrefslogtreecommitdiff
path: root/src/mono_fooify.sig
blob: 9eb8038baddecd4a8af78fd6129612e22086500b (plain)
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
signature MONO_FOOIFY = sig

(* TODO: don't expose raw references if possible. *)
val nextPvar : int ref
val pvarDefs : ((string * int * (string * int * Mono.typ option) list) list) ref

datatype foo_kind = Attr | Url

structure Fm : sig
    type t

    type vr = string * int * Mono.typ * Mono.exp * string

    val empty : int -> t

    val lookup : t -> foo_kind -> int -> (int -> t -> vr * t) -> t * int
    val lookupList : t -> foo_kind -> Mono.typ -> (int -> t -> vr * t) -> t * int
    val enter : t -> t
    val decls : t -> Mono.decl list

    val freshName : t -> int * t

    (* Set at the end of [Monoize]. *)
    val canonical : t ref
end

(* General form used in [Monoize]. *)
val fooifyExp : foo_kind
                -> (int -> Mono.typ * string)
                -> (int -> string * (string * int * Mono.typ option) list)
                -> Fm.t
                -> Mono.exp * Mono.typ
                -> Mono.exp * Fm.t

(* Easy-to-use special case used in [Sqlcache]. *)
val urlify : MonoEnv.env -> Mono.exp * Mono.typ -> Mono.exp

end