annotate src/mono_fooify.sig @ 2281:75cb60a7f6f1

Simplify C interface.
author Ziv Scully <ziv@mit.edu>
date Thu, 12 Nov 2015 09:15:50 -0500
parents f81f1930c5d6
children
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@2261 19 (* This list should be reversed before adding to list of file declarations. *)
ziv@2254 20 val decls : t -> Mono.decl list
ziv@2254 21
ziv@2254 22 val freshName : t -> int * t
ziv@2254 23 end
ziv@2254 24
ziv@2254 25 (* General form used in [Monoize]. *)
ziv@2254 26 val fooifyExp : foo_kind
ziv@2254 27 -> (int -> Mono.typ * string)
ziv@2254 28 -> (int -> string * (string * int * Mono.typ option) list)
ziv@2254 29 -> Fm.t
ziv@2254 30 -> Mono.exp * Mono.typ
ziv@2254 31 -> Mono.exp * Fm.t
ziv@2254 32
ziv@2256 33 (* Easy-to-use interface in [Sqlcache]. Uses [Fm.canonical]. *)
ziv@2256 34 val canonicalFm : Fm.t ref (* Set at the end of [Monoize]. *)
ziv@2256 35 val urlify : MonoEnv.env -> Mono.exp * Mono.typ -> Mono.exp option
ziv@2261 36 (* This list should be reversed before adding to list of file declarations. *)
ziv@2256 37 val getNewFmDecls : unit -> Mono.decl list
ziv@2254 38
ziv@2254 39 end