Skip to content
This repository
Newer
Older
100644 84 lines (62 sloc) 2.051 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 Reduced QmlFlat Server-side library.
21 @author Mathieu Barbin
22 *)
23
24 (**
25 Exporting only what is inserted by the back-end.
26 Compatible with ServerLib types.
27
28 This module redefines all needed functions from Flat_Runtime for beeing compatible with the module ServerLib.
29 *)
30
31 type flat_record = Obj.t array
32
33 module Field :
34 sig
35 type t = ServerLib.field
36 val register : string -> ServerLib.field
37 end
38
39 module FieldAccess :
40 sig
41 type cache
42 val make_cache : unit -> cache
43 end
44
45 module VTable :
46 sig
47 type t
48 val register : string array -> t
49 end
50
51 type record = ServerLib.ty_record
52
53 module Simple :
54 sig
55 val register : string -> record
56 end
57
58 val runtime_error : string -> 'a
59 external unwrap_record : record -> _ array = "%identity"
60
61 external get_vtable : ServerLib.ty_record -> VTable.t = "%field0"
62
63 val empty : record
64 val true_ : record
65 val false_ : record
66
67 val wrap_bool : bool -> record
68 val unwrap_bool : record -> bool
69
70 val none : record
71 val some : 'a -> record
72 val unwrap_option : record -> 'a option
73
74 val dot : Field.t -> record -> 'a
75 val dot_opt : Field.t -> record -> 'a option
76 val unsafe_get : int -> record -> 'a
77
78 val dot_with_cache : FieldAccess.cache -> Field.t -> record -> 'a
79
80 val extend_with_array : record -> (Field.t * Obj.t) array -> record
81 external unsafe_init_static : flat_record -> record = "%identity"
82 val may_be_simple : flat_record -> record
83
84 val do_exit : int -> 'a
Something went wrong with that request. Please try again.