Mercurial > urweb
annotate src/mono_fooify.sig @ 2256:6f2ea4ed573a
Pure caching sort of works.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sun, 27 Sep 2015 03:52:14 -0400 |
parents | 44ae2254f8fb |
children | f81f1930c5d6 |
rev | line source |
---|---|
ziv@2254 | 1 signature MONO_FOOIFY = sig |
ziv@2254 | 2 |
ziv@2254 | 3 (* TODO: don't expose raw references if possible. *) |
ziv@2254 | 4 val nextPvar : int ref |
ziv@2254 | 5 val pvarDefs : ((string * int * (string * int * Mono.typ option) list) list) ref |
ziv@2254 | 6 |
ziv@2254 | 7 datatype foo_kind = Attr | Url |
ziv@2254 | 8 |
ziv@2254 | 9 structure Fm : sig |
ziv@2254 | 10 type t |
ziv@2254 | 11 |
ziv@2254 | 12 type vr = string * int * Mono.typ * Mono.exp * string |
ziv@2254 | 13 |
ziv@2254 | 14 val empty : int -> t |
ziv@2254 | 15 |
ziv@2254 | 16 val lookup : t -> foo_kind -> int -> (int -> t -> vr * t) -> t * int |
ziv@2254 | 17 val lookupList : t -> foo_kind -> Mono.typ -> (int -> t -> vr * t) -> t * int |
ziv@2254 | 18 val enter : t -> t |
ziv@2254 | 19 val decls : t -> Mono.decl list |
ziv@2254 | 20 |
ziv@2254 | 21 val freshName : t -> int * t |
ziv@2254 | 22 end |
ziv@2254 | 23 |
ziv@2254 | 24 (* General form used in [Monoize]. *) |
ziv@2254 | 25 val fooifyExp : foo_kind |
ziv@2254 | 26 -> (int -> Mono.typ * string) |
ziv@2254 | 27 -> (int -> string * (string * int * Mono.typ option) list) |
ziv@2254 | 28 -> Fm.t |
ziv@2254 | 29 -> Mono.exp * Mono.typ |
ziv@2254 | 30 -> Mono.exp * Fm.t |
ziv@2254 | 31 |
ziv@2256 | 32 (* Easy-to-use interface in [Sqlcache]. Uses [Fm.canonical]. *) |
ziv@2256 | 33 val canonicalFm : Fm.t ref (* Set at the end of [Monoize]. *) |
ziv@2256 | 34 val urlify : MonoEnv.env -> Mono.exp * Mono.typ -> Mono.exp option |
ziv@2256 | 35 val getNewFmDecls : unit -> Mono.decl list |
ziv@2254 | 36 |
ziv@2254 | 37 end |