Mercurial > urweb
comparison src/mono_fooify.sig @ 2254:44ae2254f8fb
Factor out urlification.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Mon, 21 Sep 2015 16:07:35 -0400 |
parents | |
children | 6f2ea4ed573a |
comparison
equal
deleted
inserted
replaced
2253:d665925acff8 | 2254:44ae2254f8fb |
---|---|
1 signature MONO_FOOIFY = sig | |
2 | |
3 (* TODO: don't expose raw references if possible. *) | |
4 val nextPvar : int ref | |
5 val pvarDefs : ((string * int * (string * int * Mono.typ option) list) list) ref | |
6 | |
7 datatype foo_kind = Attr | Url | |
8 | |
9 structure Fm : sig | |
10 type t | |
11 | |
12 type vr = string * int * Mono.typ * Mono.exp * string | |
13 | |
14 val empty : int -> t | |
15 | |
16 val lookup : t -> foo_kind -> int -> (int -> t -> vr * t) -> t * int | |
17 val lookupList : t -> foo_kind -> Mono.typ -> (int -> t -> vr * t) -> t * int | |
18 val enter : t -> t | |
19 val decls : t -> Mono.decl list | |
20 | |
21 val freshName : t -> int * t | |
22 | |
23 (* Set at the end of [Monoize]. *) | |
24 val canonical : t ref | |
25 end | |
26 | |
27 (* General form used in [Monoize]. *) | |
28 val fooifyExp : foo_kind | |
29 -> (int -> Mono.typ * string) | |
30 -> (int -> string * (string * int * Mono.typ option) list) | |
31 -> Fm.t | |
32 -> Mono.exp * Mono.typ | |
33 -> Mono.exp * Fm.t | |
34 | |
35 (* Easy-to-use special case used in [Sqlcache]. *) | |
36 val urlify : MonoEnv.env -> Mono.exp * Mono.typ -> Mono.exp | |
37 | |
38 end |