package core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file make_stable.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
open Stable_module_types
module Binable = Binable.Stable
module Comparator = Comparator.Stable
module Sexpable = Sexpable.Stable

module Of_stable_format = struct
  module V1 (Stable_format : sig
    type t [@@deriving bin_io, sexp]
  end) (M : sig
    type t [@@deriving compare]

    val to_stable_format : t -> Stable_format.t
    val of_stable_format : Stable_format.t -> t
  end) : S0 with type t = M.t = struct
    module T1 = struct
      module T2 = struct
        include M

        let to_sexpable = to_stable_format
        let of_sexpable = of_stable_format
        let to_binable = to_stable_format
        let of_binable = of_stable_format
      end

      include T2
      include Sexpable.Of_sexpable.V1 (Stable_format) (T2)
      include Binable.Of_binable.V1 [@alert "-legacy"] (Stable_format) (T2)
    end

    include T1
    include Comparator.V1.Make (T1)
  end

  module V2 (Stable_format : sig
    type t [@@deriving bin_io, sexp]
  end) (M : sig
    type t [@@deriving compare]

    val to_stable_format : t -> Stable_format.t
    val of_stable_format : Stable_format.t -> t
    val caller_identity : Bin_shape.Uuid.t
  end) : S0 with type t = M.t = struct
    module T1 = struct
      module T2 = struct
        include M

        let to_sexpable = to_stable_format
        let of_sexpable = of_stable_format
        let to_binable = to_stable_format
        let of_binable = of_stable_format
      end

      include T2
      include Sexpable.Of_sexpable.V1 (Stable_format) (T2)
      include Binable.Of_binable.V2 (Stable_format) (T2)
    end

    include T1
    include Comparator.V1.Make (T1)
  end
end

module Of_stable_format1 = struct
  module V1 (Stable_format : sig
    type 'a t [@@deriving bin_io, sexp]
  end) (M : sig
    type 'a t [@@deriving compare]

    val map : 'a t -> f:('a -> 'b) -> 'b t
    val to_stable_format : 'a t -> 'a Stable_format.t
    val of_stable_format : 'a Stable_format.t -> 'a t
  end) : S1 with type 'a t = 'a M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable1.V1 (Stable_format) (T)
    include Binable.Of_binable1.V1 [@alert "-legacy"] (Stable_format) (T)
  end

  module V2 (Stable_format : sig
    type 'a t [@@deriving bin_io, sexp]
  end) (M : sig
    type 'a t [@@deriving compare]

    val map : 'a t -> f:('a -> 'b) -> 'b t
    val to_stable_format : 'a t -> 'a Stable_format.t
    val of_stable_format : 'a Stable_format.t -> 'a t
    val caller_identity : Bin_shape.Uuid.t
  end) : S1 with type 'a t = 'a M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable1.V1 (Stable_format) (T)
    include Binable.Of_binable1.V2 (Stable_format) (T)
  end
end

module Of_stable_format2 = struct
  module V1 (Stable_format : sig
    type ('a1, 'a2) t [@@deriving bin_io, sexp]
  end) (M : sig
    type ('a1, 'a2) t [@@deriving compare]

    val map : ('a1, 'a2) t -> f1:('a1 -> 'b1) -> f2:('a2 -> 'b2) -> ('b1, 'b2) t
    val to_stable_format : ('a1, 'a2) t -> ('a1, 'a2) Stable_format.t
    val of_stable_format : ('a1, 'a2) Stable_format.t -> ('a1, 'a2) t
  end) : S2 with type ('a1, 'a2) t = ('a1, 'a2) M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable2.V1 (Stable_format) (T)
    include Binable.Of_binable2.V1 [@alert "-legacy"] (Stable_format) (T)
  end

  module V2 (Stable_format : sig
    type ('a1, 'a2) t [@@deriving bin_io, sexp]
  end) (M : sig
    type ('a1, 'a2) t [@@deriving compare]

    val map : ('a1, 'a2) t -> f1:('a1 -> 'b1) -> f2:('a2 -> 'b2) -> ('b1, 'b2) t
    val to_stable_format : ('a1, 'a2) t -> ('a1, 'a2) Stable_format.t
    val of_stable_format : ('a1, 'a2) Stable_format.t -> ('a1, 'a2) t
    val caller_identity : Bin_shape.Uuid.t
  end) : S2 with type ('a1, 'a2) t = ('a1, 'a2) M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable2.V1 (Stable_format) (T)
    include Binable.Of_binable2.V2 (Stable_format) (T)
  end
end

module Of_stable_format3 = struct
  module V1 (Stable_format : sig
    type ('a1, 'a2, 'a3) t [@@deriving bin_io, sexp]
  end) (M : sig
    type ('a1, 'a2, 'a3) t [@@deriving compare]

    val map
      :  ('a1, 'a2, 'a3) t
      -> f1:('a1 -> 'b1)
      -> f2:('a2 -> 'b2)
      -> f3:('a3 -> 'b3)
      -> ('b1, 'b2, 'b3) t

    val to_stable_format : ('a1, 'a2, 'a3) t -> ('a1, 'a2, 'a3) Stable_format.t
    val of_stable_format : ('a1, 'a2, 'a3) Stable_format.t -> ('a1, 'a2, 'a3) t
  end) : S3 with type ('a1, 'a2, 'a3) t = ('a1, 'a2, 'a3) M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable3.V1 (Stable_format) (T)
    include Binable.Of_binable3.V1 [@alert "-legacy"] (Stable_format) (T)
  end

  module V2 (Stable_format : sig
    type ('a1, 'a2, 'a3) t [@@deriving bin_io, sexp]
  end) (M : sig
    type ('a1, 'a2, 'a3) t [@@deriving compare]

    val map
      :  ('a1, 'a2, 'a3) t
      -> f1:('a1 -> 'b1)
      -> f2:('a2 -> 'b2)
      -> f3:('a3 -> 'b3)
      -> ('b1, 'b2, 'b3) t

    val to_stable_format : ('a1, 'a2, 'a3) t -> ('a1, 'a2, 'a3) Stable_format.t
    val of_stable_format : ('a1, 'a2, 'a3) Stable_format.t -> ('a1, 'a2, 'a3) t
    val caller_identity : Bin_shape.Uuid.t
  end) : S3 with type ('a1, 'a2, 'a3) t = ('a1, 'a2, 'a3) M.t = struct
    module T = struct
      include M

      let to_sexpable = to_stable_format
      let of_sexpable = of_stable_format
      let to_binable = to_stable_format
      let of_binable = of_stable_format
    end

    include T
    include Sexpable.Of_sexpable3.V1 (Stable_format) (T)
    include Binable.Of_binable3.V2 (Stable_format) (T)
  end
end

module With_stable_witness = struct
  module Of_stable_format = struct
    module V1 (Stable_format : sig
      type t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type t [@@deriving compare]

      val to_stable_format : t -> Stable_format.t
      val of_stable_format : Stable_format.t -> t
    end) : With_stable_witness.S0 with type t = M.t = struct
      include Of_stable_format.V1 (Stable_format) (M)

      let stable_witness =
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
      ;;
    end

    module V2 (Stable_format : sig
      type t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type t [@@deriving compare]

      val to_stable_format : t -> Stable_format.t
      val of_stable_format : Stable_format.t -> t
      val caller_identity : Bin_shape.Uuid.t
    end) : With_stable_witness.S0 with type t = M.t = struct
      include Of_stable_format.V2 (Stable_format) (M)

      let stable_witness =
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
      ;;
    end
  end

  module Of_stable_format1 = struct
    module V1 (Stable_format : sig
      type 'a t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type 'a t [@@deriving compare]

      val map : 'a t -> f:('a -> 'b) -> 'b t
      val to_stable_format : 'a t -> 'a Stable_format.t
      val of_stable_format : 'a Stable_format.t -> 'a t
    end) : With_stable_witness.S1 with type 'a t = 'a M.t = struct
      include Of_stable_format1.V1 (Stable_format) (M)

      let stable_witness (type a) : a Stable_witness.t -> a M.t Stable_witness.t =
        fun witness ->
        let module Stable_witness = Stable_witness.Of_serializable1 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end

    module V2 (Stable_format : sig
      type 'a t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type 'a t [@@deriving compare]

      val map : 'a t -> f:('a -> 'b) -> 'b t
      val to_stable_format : 'a t -> 'a Stable_format.t
      val of_stable_format : 'a Stable_format.t -> 'a t
      val caller_identity : Bin_shape.Uuid.t
    end) : With_stable_witness.S1 with type 'a t = 'a M.t = struct
      include Of_stable_format1.V2 (Stable_format) (M)

      let stable_witness (type a) : a Stable_witness.t -> a M.t Stable_witness.t =
        fun witness ->
        let module Stable_witness = Stable_witness.Of_serializable1 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end
  end

  module Of_stable_format2 = struct
    module V1 (Stable_format : sig
      type ('a1, 'a2) t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type ('a1, 'a2) t [@@deriving compare]

      val map : ('a1, 'a2) t -> f1:('a1 -> 'b1) -> f2:('a2 -> 'b2) -> ('b1, 'b2) t
      val to_stable_format : ('a1, 'a2) t -> ('a1, 'a2) Stable_format.t
      val of_stable_format : ('a1, 'a2) Stable_format.t -> ('a1, 'a2) t
    end) : With_stable_witness.S2 with type ('a1, 'a2) t = ('a1, 'a2) M.t = struct
      include Of_stable_format2.V1 (Stable_format) (M)

      let stable_witness witness =
        let module Stable_witness = Stable_witness.Of_serializable2 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end

    module V2 (Stable_format : sig
      type ('a1, 'a2) t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type ('a1, 'a2) t [@@deriving compare]

      val map : ('a1, 'a2) t -> f1:('a1 -> 'b1) -> f2:('a2 -> 'b2) -> ('b1, 'b2) t
      val to_stable_format : ('a1, 'a2) t -> ('a1, 'a2) Stable_format.t
      val of_stable_format : ('a1, 'a2) Stable_format.t -> ('a1, 'a2) t
      val caller_identity : Bin_shape.Uuid.t
    end) : With_stable_witness.S2 with type ('a1, 'a2) t = ('a1, 'a2) M.t = struct
      include Of_stable_format2.V2 (Stable_format) (M)

      let stable_witness witness =
        let module Stable_witness = Stable_witness.Of_serializable2 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end
  end

  module Of_stable_format3 = struct
    module V1 (Stable_format : sig
      type ('a1, 'a2, 'a3) t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type ('a1, 'a2, 'a3) t [@@deriving compare]

      val map
        :  ('a1, 'a2, 'a3) t
        -> f1:('a1 -> 'b1)
        -> f2:('a2 -> 'b2)
        -> f3:('a3 -> 'b3)
        -> ('b1, 'b2, 'b3) t

      val to_stable_format : ('a1, 'a2, 'a3) t -> ('a1, 'a2, 'a3) Stable_format.t
      val of_stable_format : ('a1, 'a2, 'a3) Stable_format.t -> ('a1, 'a2, 'a3) t
    end) : With_stable_witness.S3 with type ('a1, 'a2, 'a3) t = ('a1, 'a2, 'a3) M.t =
    struct
      include Of_stable_format3.V1 (Stable_format) (M)

      let stable_witness witness =
        let module Stable_witness = Stable_witness.Of_serializable3 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end

    module V2 (Stable_format : sig
      type ('a1, 'a2, 'a3) t [@@deriving bin_io, sexp, stable_witness]
    end) (M : sig
      type ('a1, 'a2, 'a3) t [@@deriving compare]

      val map
        :  ('a1, 'a2, 'a3) t
        -> f1:('a1 -> 'b1)
        -> f2:('a2 -> 'b2)
        -> f3:('a3 -> 'b3)
        -> ('b1, 'b2, 'b3) t

      val to_stable_format : ('a1, 'a2, 'a3) t -> ('a1, 'a2, 'a3) Stable_format.t
      val of_stable_format : ('a1, 'a2, 'a3) Stable_format.t -> ('a1, 'a2, 'a3) t
      val caller_identity : Bin_shape.Uuid.t
    end) : With_stable_witness.S3 with type ('a1, 'a2, 'a3) t = ('a1, 'a2, 'a3) M.t =
    struct
      include Of_stable_format3.V2 (Stable_format) (M)

      let stable_witness witness =
        let module Stable_witness = Stable_witness.Of_serializable3 (Stable_format) (M) in
        Stable_witness.of_serializable
          Stable_format.stable_witness
          M.of_stable_format
          M.to_stable_format
          witness
      ;;
    end
  end
end
OCaml

Innovation. Community. Security.