Debian Codegraph @

src/binable.ml

raw symbols SCIP
1 (* Binable: signatures defining generated functions for the binary protocol.
2 [S, S1, etc] are the signatures satisfied by the generated code and
3 [Minimal.S, Minimal.S1, etc] are the signatures that generated code uses. *)
4
5 (* the subset of S containing only functions, so that one can recursively define modules
6 implementing this interface *)
7 module type S_only_functions = sig
8 type t
9
10 val bin_size_t : t Size.sizer
11 val bin_write_t : t Write.writer
12 val bin_read_t : t Read.reader
13
14 (**
15 This function only needs implementation if [t] exposed to be a polymorphic variant.
16 Despite what the type reads, this does *not* produce a function after reading;
17 instead it takes the constructor tag (int) before reading and reads the rest of the
18 variant [t] afterwards.
19 *)
20 val __bin_read_t__ : (int -> t) Read.reader
21 end
22
23 module type S_local_only_functions = sig
24 include S_only_functions
25
26 val bin_size_t__local : t Size.sizer_local
27 val bin_write_t__local : t Write.writer_local
28 end
29
30 module type S = sig
31 type t
32
33 include S_only_functions with type t := t
34
35 val bin_shape_t : Shape.t
36 val bin_writer_t : t Type_class.writer
37 val bin_reader_t : t Type_class.reader
38 val bin_t : t Type_class.t
39 end
40
41 module type S_local = sig
42 type t
43
44 include S_local_only_functions with type t := t
45
46 val bin_shape_t : Shape.t
47 val bin_writer_t : t Type_class.writer
48 val bin_reader_t : t Type_class.reader
49 val bin_t : t Type_class.t
50 end
51
52 module type S1 = sig
53 type 'a t
54
55 val bin_shape_t : Shape.t -> Shape.t
56 val bin_size_t : ('a, 'a t) Size.sizer1
57 val bin_write_t : ('a, 'a t) Write.writer1
58 val bin_read_t : ('a, 'a t) Read.reader1
59 val __bin_read_t__ : ('a, int -> 'a t) Read.reader1
60 val bin_writer_t : ('a, 'a t) Type_class.S1.writer
61 val bin_reader_t : ('a, 'a t) Type_class.S1.reader
62 val bin_t : ('a, 'a t) Type_class.S1.t
63 end
64
65 module type S_local1 = sig
66 include S1
67
68 val bin_size_t__local : ('a, 'a t) Size.sizer_local1
69 val bin_write_t__local : ('a, 'a t) Write.writer_local1
70 end
71
72 module type S2 = sig
73 type ('a, 'b) t
74
75 val bin_shape_t : Shape.t -> Shape.t -> Shape.t
76 val bin_size_t : ('a, 'b, ('a, 'b) t) Size.sizer2
77 val bin_write_t : ('a, 'b, ('a, 'b) t) Write.writer2
78 val bin_read_t : ('a, 'b, ('a, 'b) t) Read.reader2
79 val __bin_read_t__ : ('a, 'b, int -> ('a, 'b) t) Read.reader2
80 val bin_writer_t : ('a, 'b, ('a, 'b) t) Type_class.S2.writer
81 val bin_reader_t : ('a, 'b, ('a, 'b) t) Type_class.S2.reader
82 val bin_t : ('a, 'b, ('a, 'b) t) Type_class.S2.t
83 end
84
85 module type S_local2 = sig
86 include S2
87
88 val bin_size_t__local : ('a, 'b, ('a, 'b) t) Size.sizer_local2
89 val bin_write_t__local : ('a, 'b, ('a, 'b) t) Write.writer_local2
90 end
91
92 module type S3 = sig
93 type ('a, 'b, 'c) t
94
95 val bin_shape_t : Shape.t -> Shape.t -> Shape.t -> Shape.t
96 val bin_size_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Size.sizer3
97 val bin_write_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Write.writer3
98 val bin_read_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Read.reader3
99 val __bin_read_t__ : ('a, 'b, 'c, int -> ('a, 'b, 'c) t) Read.reader3
100 val bin_writer_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Type_class.S3.writer
101 val bin_reader_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Type_class.S3.reader
102 val bin_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Type_class.S3.t
103 end
104
105 module type S_local3 = sig
106 include S3
107
108 val bin_size_t__local : ('a, 'b, 'c, ('a, 'b, 'c) t) Size.sizer_local3
109 val bin_write_t__local : ('a, 'b, 'c, ('a, 'b, 'c) t) Write.writer_local3
110 end
111
112 module Minimal = struct
113 module type S = sig
114 type t
115
116 val bin_shape_t : Shape.t
117 val bin_size_t : t Size.sizer
118 val bin_write_t : t Write.writer
119 val bin_read_t : t Read.reader
120 val __bin_read_t__ : (int -> t) Read.reader
121 end
122
123 module type S_local = sig
124 include S
125
126 val bin_size_t__local : t Size.sizer_local
127 val bin_write_t__local : t Write.writer_local
128 end
129
130 module type S1 = sig
131 type 'a t
132
133 val bin_shape_t : Shape.t -> Shape.t
134 val bin_size_t : ('a, 'a t) Size.sizer1
135 val bin_write_t : ('a, 'a t) Write.writer1
136 val bin_read_t : ('a, 'a t) Read.reader1
137 val __bin_read_t__ : ('a, int -> 'a t) Read.reader1
138 end
139
140 module type S_local1 = sig
141 include S1
142
143 val bin_size_t__local : ('a, 'a t) Size.sizer_local1
144 val bin_write_t__local : ('a, 'a t) Write.writer_local1
145 end
146
147 module type S2 = sig
148 type ('a, 'b) t
149
150 val bin_shape_t : Shape.t -> Shape.t -> Shape.t
151 val bin_size_t : ('a, 'b, ('a, 'b) t) Size.sizer2
152 val bin_write_t : ('a, 'b, ('a, 'b) t) Write.writer2
153 val bin_read_t : ('a, 'b, ('a, 'b) t) Read.reader2
154 val __bin_read_t__ : ('a, 'b, int -> ('a, 'b) t) Read.reader2
155 end
156
157 module type S_local2 = sig
158 include S2
159
160 val bin_size_t__local : ('a, 'b, ('a, 'b) t) Size.sizer_local2
161 val bin_write_t__local : ('a, 'b, ('a, 'b) t) Write.writer_local2
162 end
163
164 module type S3 = sig
165 type ('a, 'b, 'c) t
166
167 val bin_shape_t : Shape.t -> Shape.t -> Shape.t -> Shape.t
168 val bin_size_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Size.sizer3
169 val bin_write_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Write.writer3
170 val bin_read_t : ('a, 'b, 'c, ('a, 'b, 'c) t) Read.reader3
171 val __bin_read_t__ : ('a, 'b, 'c, int -> ('a, 'b, 'c) t) Read.reader3
172 end
173
174 module type S_local3 = sig
175 include S3
176
177 val bin_size_t__local : ('a, 'b, 'c, ('a, 'b, 'c) t) Size.sizer_local3
178 val bin_write_t__local : ('a, 'b, 'c, ('a, 'b, 'c) t) Write.writer_local3
179 end
180 end