| 1 | open! Base |
| 2 | |
| 3 | open struct |
| 4 | type _shadow_constructors = |
| 5 | | [] |
| 6 | | ( :: ) |
| 7 | | None |
| 8 | | Some |
| 9 | end |
| 10 | |
| 11 | module Abstract = struct |
| 12 | type t [@@deriving_inline sexp] |
| 13 | |
| 14 | let _ = fun (_ : t) -> () |
| 15 | |
| 16 | let t_of_sexp = |
| 17 | (let error_source__002_ = "expansion.ml.Abstract.t" in |
| 18 | fun x__003_ -> Sexplib0.Sexp_conv_error.empty_type error_source__002_ x__003_ |
| 19 | : Sexplib0.Sexp.t -> t) |
| 20 | ;; |
| 21 | |
| 22 | let _ = t_of_sexp |
| 23 | let sexp_of_t = (fun _ -> assert false : t -> Sexplib0.Sexp.t) |
| 24 | let _ = sexp_of_t |
| 25 | |
| 26 | [@@@end] |
| 27 | end |
| 28 | |
| 29 | module Tuple = struct |
| 30 | type t = int * int * int [@@deriving_inline sexp] |
| 31 | |
| 32 | let _ = fun (_ : t) -> () |
| 33 | |
| 34 | let t_of_sexp = |
| 35 | (let error_source__012_ = "expansion.ml.Tuple.t" in |
| 36 | function |
| 37 | | Sexplib0.Sexp.List [ arg0__005_; arg1__006_; arg2__007_ ] -> |
| 38 | let res0__008_ = int_of_sexp arg0__005_ |
| 39 | and res1__009_ = int_of_sexp arg1__006_ |
| 40 | and res2__010_ = int_of_sexp arg2__007_ in |
| 41 | res0__008_, res1__009_, res2__010_ |
| 42 | | sexp__011_ -> |
| 43 | Sexplib0.Sexp_conv_error.tuple_of_size_n_expected error_source__012_ 3 sexp__011_ |
| 44 | : Sexplib0.Sexp.t -> t) |
| 45 | ;; |
| 46 | |
| 47 | let _ = t_of_sexp |
| 48 | |
| 49 | let sexp_of_t = |
| 50 | (fun (arg0__013_, arg1__014_, arg2__015_) -> |
| 51 | let res0__016_ = sexp_of_int arg0__013_ |
| 52 | and res1__017_ = sexp_of_int arg1__014_ |
| 53 | and res2__018_ = sexp_of_int arg2__015_ in |
| 54 | Sexplib0.Sexp.List [ res0__016_; res1__017_; res2__018_ ] |
| 55 | : t -> Sexplib0.Sexp.t) |
| 56 | ;; |
| 57 | |
| 58 | let _ = sexp_of_t |
| 59 | |
| 60 | [@@@end] |
| 61 | end |
| 62 | |
| 63 | module Record = struct |
| 64 | type t = |
| 65 | { a : int |
| 66 | ; b : int |
| 67 | ; c : int |
| 68 | } |
| 69 | [@@deriving_inline sexp] |
| 70 | |
| 71 | let _ = fun (_ : t) -> () |
| 72 | |
| 73 | let t_of_sexp = |
| 74 | (let error_source__020_ = "expansion.ml.Record.t" in |
| 75 | fun x__021_ -> |
| 76 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 77 | ~caller:error_source__020_ |
| 78 | ~fields: |
| 79 | (Field |
| 80 | { name = "a" |
| 81 | ; kind = Required |
| 82 | ; conv = int_of_sexp |
| 83 | ; rest = |
| 84 | Field |
| 85 | { name = "b" |
| 86 | ; kind = Required |
| 87 | ; conv = int_of_sexp |
| 88 | ; rest = |
| 89 | Field |
| 90 | { name = "c" |
| 91 | ; kind = Required |
| 92 | ; conv = int_of_sexp |
| 93 | ; rest = Empty |
| 94 | } |
| 95 | } |
| 96 | }) |
| 97 | ~index_of_field:(function |
| 98 | | "a" -> 0 |
| 99 | | "b" -> 1 |
| 100 | | "c" -> 2 |
| 101 | | _ -> -1) |
| 102 | ~allow_extra_fields:false |
| 103 | ~create:(fun (a, (b, (c, ()))) : t -> { a; b; c }) |
| 104 | x__021_ |
| 105 | : Sexplib0.Sexp.t -> t) |
| 106 | ;; |
| 107 | |
| 108 | let _ = t_of_sexp |
| 109 | |
| 110 | let sexp_of_t = |
| 111 | (fun { a = a__023_; b = b__025_; c = c__027_ } -> |
| 112 | let bnds__022_ = ([] : _ Stdlib.List.t) in |
| 113 | let bnds__022_ = |
| 114 | let arg__028_ = sexp_of_int c__027_ in |
| 115 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__028_ ] :: bnds__022_ |
| 116 | : _ Stdlib.List.t) |
| 117 | in |
| 118 | let bnds__022_ = |
| 119 | let arg__026_ = sexp_of_int b__025_ in |
| 120 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__026_ ] :: bnds__022_ |
| 121 | : _ Stdlib.List.t) |
| 122 | in |
| 123 | let bnds__022_ = |
| 124 | let arg__024_ = sexp_of_int a__023_ in |
| 125 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__024_ ] :: bnds__022_ |
| 126 | : _ Stdlib.List.t) |
| 127 | in |
| 128 | Sexplib0.Sexp.List bnds__022_ |
| 129 | : t -> Sexplib0.Sexp.t) |
| 130 | ;; |
| 131 | |
| 132 | let _ = sexp_of_t |
| 133 | |
| 134 | [@@@end] |
| 135 | end |
| 136 | |
| 137 | module Mutable_record = struct |
| 138 | type t = |
| 139 | { mutable a : int |
| 140 | ; mutable b : int |
| 141 | ; mutable c : int |
| 142 | } |
| 143 | [@@deriving_inline sexp] |
| 144 | |
| 145 | let _ = fun (_ : t) -> () |
| 146 | |
| 147 | let t_of_sexp = |
| 148 | (let error_source__030_ = "expansion.ml.Mutable_record.t" in |
| 149 | fun x__031_ -> |
| 150 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 151 | ~caller:error_source__030_ |
| 152 | ~fields: |
| 153 | (Field |
| 154 | { name = "a" |
| 155 | ; kind = Required |
| 156 | ; conv = int_of_sexp |
| 157 | ; rest = |
| 158 | Field |
| 159 | { name = "b" |
| 160 | ; kind = Required |
| 161 | ; conv = int_of_sexp |
| 162 | ; rest = |
| 163 | Field |
| 164 | { name = "c" |
| 165 | ; kind = Required |
| 166 | ; conv = int_of_sexp |
| 167 | ; rest = Empty |
| 168 | } |
| 169 | } |
| 170 | }) |
| 171 | ~index_of_field:(function |
| 172 | | "a" -> 0 |
| 173 | | "b" -> 1 |
| 174 | | "c" -> 2 |
| 175 | | _ -> -1) |
| 176 | ~allow_extra_fields:false |
| 177 | ~create:(fun (a, (b, (c, ()))) : t -> { a; b; c }) |
| 178 | x__031_ |
| 179 | : Sexplib0.Sexp.t -> t) |
| 180 | ;; |
| 181 | |
| 182 | let _ = t_of_sexp |
| 183 | |
| 184 | let sexp_of_t = |
| 185 | (fun { a = a__033_; b = b__035_; c = c__037_ } -> |
| 186 | let bnds__032_ = ([] : _ Stdlib.List.t) in |
| 187 | let bnds__032_ = |
| 188 | let arg__038_ = sexp_of_int c__037_ in |
| 189 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__038_ ] :: bnds__032_ |
| 190 | : _ Stdlib.List.t) |
| 191 | in |
| 192 | let bnds__032_ = |
| 193 | let arg__036_ = sexp_of_int b__035_ in |
| 194 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__036_ ] :: bnds__032_ |
| 195 | : _ Stdlib.List.t) |
| 196 | in |
| 197 | let bnds__032_ = |
| 198 | let arg__034_ = sexp_of_int a__033_ in |
| 199 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__034_ ] :: bnds__032_ |
| 200 | : _ Stdlib.List.t) |
| 201 | in |
| 202 | Sexplib0.Sexp.List bnds__032_ |
| 203 | : t -> Sexplib0.Sexp.t) |
| 204 | ;; |
| 205 | |
| 206 | let _ = sexp_of_t |
| 207 | |
| 208 | [@@@end] |
| 209 | end |
| 210 | |
| 211 | module Variant = struct |
| 212 | type t = |
| 213 | | A |
| 214 | | B of int * int |
| 215 | | C of |
| 216 | { a : int |
| 217 | ; b : int |
| 218 | ; d : int |
| 219 | } |
| 220 | | D of |
| 221 | { mutable a : int |
| 222 | ; mutable b : int |
| 223 | ; mutable t : int |
| 224 | } |
| 225 | [@@deriving_inline sexp] |
| 226 | |
| 227 | let _ = fun (_ : t) -> () |
| 228 | |
| 229 | let t_of_sexp = |
| 230 | (let error_source__041_ = "expansion.ml.Variant.t" in |
| 231 | function |
| 232 | | Sexplib0.Sexp.Atom ("a" | "A") -> A |
| 233 | | Sexplib0.Sexp.List |
| 234 | (Sexplib0.Sexp.Atom (("b" | "B") as _tag__044_) :: sexp_args__045_) as |
| 235 | _sexp__043_ -> |
| 236 | (match sexp_args__045_ with |
| 237 | | [ arg0__046_; arg1__047_ ] -> |
| 238 | let res0__048_ = int_of_sexp arg0__046_ |
| 239 | and res1__049_ = int_of_sexp arg1__047_ in |
| 240 | B (res0__048_, res1__049_) |
| 241 | | _ -> |
| 242 | Sexplib0.Sexp_conv_error.stag_incorrect_n_args |
| 243 | error_source__041_ |
| 244 | _tag__044_ |
| 245 | _sexp__043_) |
| 246 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("c" | "C") :: sexps__051_) as sexp__050_ -> |
| 247 | Sexplib0.Sexp_conv_record.record_of_sexps |
| 248 | ~context:sexp__050_ |
| 249 | ~caller:error_source__041_ |
| 250 | ~fields: |
| 251 | (Field |
| 252 | { name = "a" |
| 253 | ; kind = Required |
| 254 | ; conv = int_of_sexp |
| 255 | ; rest = |
| 256 | Field |
| 257 | { name = "b" |
| 258 | ; kind = Required |
| 259 | ; conv = int_of_sexp |
| 260 | ; rest = |
| 261 | Field |
| 262 | { name = "d" |
| 263 | ; kind = Required |
| 264 | ; conv = int_of_sexp |
| 265 | ; rest = Empty |
| 266 | } |
| 267 | } |
| 268 | }) |
| 269 | ~index_of_field:(function |
| 270 | | "a" -> 0 |
| 271 | | "b" -> 1 |
| 272 | | "d" -> 2 |
| 273 | | _ -> -1) |
| 274 | ~allow_extra_fields:false |
| 275 | ~create:(fun (a, (b, (d, ()))) : t -> C { a; b; d }) |
| 276 | sexps__051_ |
| 277 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("d" | "D") :: sexps__053_) as sexp__052_ -> |
| 278 | Sexplib0.Sexp_conv_record.record_of_sexps |
| 279 | ~context:sexp__052_ |
| 280 | ~caller:error_source__041_ |
| 281 | ~fields: |
| 282 | (Field |
| 283 | { name = "a" |
| 284 | ; kind = Required |
| 285 | ; conv = int_of_sexp |
| 286 | ; rest = |
| 287 | Field |
| 288 | { name = "b" |
| 289 | ; kind = Required |
| 290 | ; conv = int_of_sexp |
| 291 | ; rest = |
| 292 | Field |
| 293 | { name = "t" |
| 294 | ; kind = Required |
| 295 | ; conv = int_of_sexp |
| 296 | ; rest = Empty |
| 297 | } |
| 298 | } |
| 299 | }) |
| 300 | ~index_of_field:(function |
| 301 | | "a" -> 0 |
| 302 | | "b" -> 1 |
| 303 | | "t" -> 2 |
| 304 | | _ -> -1) |
| 305 | ~allow_extra_fields:false |
| 306 | ~create:(fun (a, (b, (t, ()))) : t -> D { a; b; t }) |
| 307 | sexps__053_ |
| 308 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("a" | "A") :: _) as sexp__042_ -> |
| 309 | Sexplib0.Sexp_conv_error.stag_no_args error_source__041_ sexp__042_ |
| 310 | | Sexplib0.Sexp.Atom ("b" | "B") as sexp__042_ -> |
| 311 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__041_ sexp__042_ |
| 312 | | Sexplib0.Sexp.Atom ("c" | "C") as sexp__042_ -> |
| 313 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__041_ sexp__042_ |
| 314 | | Sexplib0.Sexp.Atom ("d" | "D") as sexp__042_ -> |
| 315 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__041_ sexp__042_ |
| 316 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__040_ -> |
| 317 | Sexplib0.Sexp_conv_error.nested_list_invalid_sum error_source__041_ sexp__040_ |
| 318 | | Sexplib0.Sexp.List [] as sexp__040_ -> |
| 319 | Sexplib0.Sexp_conv_error.empty_list_invalid_sum error_source__041_ sexp__040_ |
| 320 | | sexp__040_ -> |
| 321 | Sexplib0.Sexp_conv_error.unexpected_stag error_source__041_ sexp__040_ |
| 322 | : Sexplib0.Sexp.t -> t) |
| 323 | ;; |
| 324 | |
| 325 | let _ = t_of_sexp |
| 326 | |
| 327 | let sexp_of_t = |
| 328 | (function |
| 329 | | A -> Sexplib0.Sexp.Atom "A" |
| 330 | | B (arg0__054_, arg1__055_) -> |
| 331 | let res0__056_ = sexp_of_int arg0__054_ |
| 332 | and res1__057_ = sexp_of_int arg1__055_ in |
| 333 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "B"; res0__056_; res1__057_ ] |
| 334 | | C { a = a__059_; b = b__061_; d = d__063_ } -> |
| 335 | let bnds__058_ = ([] : _ Stdlib.List.t) in |
| 336 | let bnds__058_ = |
| 337 | let arg__064_ = sexp_of_int d__063_ in |
| 338 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "d"; arg__064_ ] :: bnds__058_ |
| 339 | : _ Stdlib.List.t) |
| 340 | in |
| 341 | let bnds__058_ = |
| 342 | let arg__062_ = sexp_of_int b__061_ in |
| 343 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__062_ ] :: bnds__058_ |
| 344 | : _ Stdlib.List.t) |
| 345 | in |
| 346 | let bnds__058_ = |
| 347 | let arg__060_ = sexp_of_int a__059_ in |
| 348 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__060_ ] :: bnds__058_ |
| 349 | : _ Stdlib.List.t) |
| 350 | in |
| 351 | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom "C" :: bnds__058_) |
| 352 | | D { a = a__066_; b = b__068_; t = t__070_ } -> |
| 353 | let bnds__065_ = ([] : _ Stdlib.List.t) in |
| 354 | let bnds__065_ = |
| 355 | let arg__071_ = sexp_of_int t__070_ in |
| 356 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "t"; arg__071_ ] :: bnds__065_ |
| 357 | : _ Stdlib.List.t) |
| 358 | in |
| 359 | let bnds__065_ = |
| 360 | let arg__069_ = sexp_of_int b__068_ in |
| 361 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__069_ ] :: bnds__065_ |
| 362 | : _ Stdlib.List.t) |
| 363 | in |
| 364 | let bnds__065_ = |
| 365 | let arg__067_ = sexp_of_int a__066_ in |
| 366 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__067_ ] :: bnds__065_ |
| 367 | : _ Stdlib.List.t) |
| 368 | in |
| 369 | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom "D" :: bnds__065_) |
| 370 | : t -> Sexplib0.Sexp.t) |
| 371 | ;; |
| 372 | |
| 373 | let _ = sexp_of_t |
| 374 | |
| 375 | [@@@end] |
| 376 | end |
| 377 | |
| 378 | module Poly_variant = struct |
| 379 | type t = |
| 380 | [ `A |
| 381 | | `B of int |
| 382 | ] |
| 383 | [@@deriving_inline sexp] |
| 384 | |
| 385 | let _ = fun (_ : t) -> () |
| 386 | |
| 387 | let __t_of_sexp__ = |
| 388 | (let error_source__077_ = "expansion.ml.Poly_variant.t" in |
| 389 | function |
| 390 | | Sexplib0.Sexp.Atom atom__073_ as _sexp__075_ -> |
| 391 | (match atom__073_ with |
| 392 | | "A" -> `A |
| 393 | | "B" -> Sexplib0.Sexp_conv_error.ptag_takes_args error_source__077_ _sexp__075_ |
| 394 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 395 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom atom__073_ :: sexp_args__076_) as |
| 396 | _sexp__075_ -> |
| 397 | (match atom__073_ with |
| 398 | | "B" as _tag__078_ -> |
| 399 | (match sexp_args__076_ with |
| 400 | | [ arg0__079_ ] -> |
| 401 | let res0__080_ = int_of_sexp arg0__079_ in |
| 402 | `B res0__080_ |
| 403 | | _ -> |
| 404 | Sexplib0.Sexp_conv_error.ptag_incorrect_n_args |
| 405 | error_source__077_ |
| 406 | _tag__078_ |
| 407 | _sexp__075_) |
| 408 | | "A" -> Sexplib0.Sexp_conv_error.ptag_no_args error_source__077_ _sexp__075_ |
| 409 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 410 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__074_ -> |
| 411 | Sexplib0.Sexp_conv_error.nested_list_invalid_poly_var error_source__077_ sexp__074_ |
| 412 | | Sexplib0.Sexp.List [] as sexp__074_ -> |
| 413 | Sexplib0.Sexp_conv_error.empty_list_invalid_poly_var error_source__077_ sexp__074_ |
| 414 | : Sexplib0.Sexp.t -> t) |
| 415 | ;; |
| 416 | |
| 417 | let _ = __t_of_sexp__ |
| 418 | |
| 419 | let t_of_sexp = |
| 420 | (let error_source__082_ = "expansion.ml.Poly_variant.t" in |
| 421 | fun sexp__081_ -> |
| 422 | try __t_of_sexp__ sexp__081_ with |
| 423 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 424 | Sexplib0.Sexp_conv_error.no_matching_variant_found error_source__082_ sexp__081_ |
| 425 | : Sexplib0.Sexp.t -> t) |
| 426 | ;; |
| 427 | |
| 428 | let _ = t_of_sexp |
| 429 | |
| 430 | let sexp_of_t = |
| 431 | (function |
| 432 | | `A -> Sexplib0.Sexp.Atom "A" |
| 433 | | `B v__083_ -> Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "B"; sexp_of_int v__083_ ] |
| 434 | : t -> Sexplib0.Sexp.t) |
| 435 | ;; |
| 436 | |
| 437 | let _ = sexp_of_t |
| 438 | |
| 439 | [@@@end] |
| 440 | end |
| 441 | |
| 442 | module Inline_poly_variant = struct |
| 443 | type t = |
| 444 | [ Poly_variant.t |
| 445 | | `C of int * int |
| 446 | ] |
| 447 | [@@deriving_inline sexp] |
| 448 | |
| 449 | let _ = fun (_ : t) -> () |
| 450 | |
| 451 | let __t_of_sexp__ = |
| 452 | (let error_source__095_ = "expansion.ml.Inline_poly_variant.t" in |
| 453 | fun sexp__084_ -> |
| 454 | try (Poly_variant.__t_of_sexp__ sexp__084_ :> t) with |
| 455 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 456 | (match sexp__084_ with |
| 457 | | Sexplib0.Sexp.Atom atom__085_ as _sexp__087_ -> |
| 458 | (match atom__085_ with |
| 459 | | "C" -> |
| 460 | Sexplib0.Sexp_conv_error.ptag_takes_args error_source__095_ _sexp__087_ |
| 461 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 462 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom atom__085_ :: sexp_args__088_) as |
| 463 | _sexp__087_ -> |
| 464 | (match atom__085_ with |
| 465 | | "C" as _tag__089_ -> |
| 466 | (match sexp_args__088_ with |
| 467 | | [ arg0__096_ ] -> |
| 468 | let res0__097_ = |
| 469 | match arg0__096_ with |
| 470 | | Sexplib0.Sexp.List [ arg0__090_; arg1__091_ ] -> |
| 471 | let res0__092_ = int_of_sexp arg0__090_ |
| 472 | and res1__093_ = int_of_sexp arg1__091_ in |
| 473 | res0__092_, res1__093_ |
| 474 | | sexp__094_ -> |
| 475 | Sexplib0.Sexp_conv_error.tuple_of_size_n_expected |
| 476 | error_source__095_ |
| 477 | 2 |
| 478 | sexp__094_ |
| 479 | in |
| 480 | `C res0__097_ |
| 481 | | _ -> |
| 482 | Sexplib0.Sexp_conv_error.ptag_incorrect_n_args |
| 483 | error_source__095_ |
| 484 | _tag__089_ |
| 485 | _sexp__087_) |
| 486 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 487 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__086_ -> |
| 488 | Sexplib0.Sexp_conv_error.nested_list_invalid_poly_var |
| 489 | error_source__095_ |
| 490 | sexp__086_ |
| 491 | | Sexplib0.Sexp.List [] as sexp__086_ -> |
| 492 | Sexplib0.Sexp_conv_error.empty_list_invalid_poly_var |
| 493 | error_source__095_ |
| 494 | sexp__086_) |
| 495 | : Sexplib0.Sexp.t -> t) |
| 496 | ;; |
| 497 | |
| 498 | let _ = __t_of_sexp__ |
| 499 | |
| 500 | let t_of_sexp = |
| 501 | (let error_source__099_ = "expansion.ml.Inline_poly_variant.t" in |
| 502 | fun sexp__098_ -> |
| 503 | try __t_of_sexp__ sexp__098_ with |
| 504 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 505 | Sexplib0.Sexp_conv_error.no_matching_variant_found error_source__099_ sexp__098_ |
| 506 | : Sexplib0.Sexp.t -> t) |
| 507 | ;; |
| 508 | |
| 509 | let _ = t_of_sexp |
| 510 | |
| 511 | let sexp_of_t = |
| 512 | (function |
| 513 | | #Poly_variant.t as v__100_ -> Poly_variant.sexp_of_t v__100_ |
| 514 | | `C v__101_ -> |
| 515 | Sexplib0.Sexp.List |
| 516 | [ Sexplib0.Sexp.Atom "C" |
| 517 | ; (let arg0__102_, arg1__103_ = v__101_ in |
| 518 | let res0__104_ = sexp_of_int arg0__102_ |
| 519 | and res1__105_ = sexp_of_int arg1__103_ in |
| 520 | Sexplib0.Sexp.List [ res0__104_; res1__105_ ]) |
| 521 | ] |
| 522 | : t -> Sexplib0.Sexp.t) |
| 523 | ;; |
| 524 | |
| 525 | let _ = sexp_of_t |
| 526 | |
| 527 | [@@@end] |
| 528 | end |
| 529 | |
| 530 | module Recursive = struct |
| 531 | type t = |
| 532 | | Banana of t |
| 533 | | Orange |
| 534 | [@@deriving_inline sexp] |
| 535 | |
| 536 | let _ = fun (_ : t) -> () |
| 537 | |
| 538 | let rec t_of_sexp = |
| 539 | (let error_source__108_ = "expansion.ml.Recursive.t" in |
| 540 | function |
| 541 | | Sexplib0.Sexp.List |
| 542 | (Sexplib0.Sexp.Atom (("banana" | "Banana") as _tag__111_) :: sexp_args__112_) as |
| 543 | _sexp__110_ -> |
| 544 | (match sexp_args__112_ with |
| 545 | | [ arg0__113_ ] -> |
| 546 | let res0__114_ = t_of_sexp arg0__113_ in |
| 547 | Banana res0__114_ |
| 548 | | _ -> |
| 549 | Sexplib0.Sexp_conv_error.stag_incorrect_n_args |
| 550 | error_source__108_ |
| 551 | _tag__111_ |
| 552 | _sexp__110_) |
| 553 | | Sexplib0.Sexp.Atom ("orange" | "Orange") -> Orange |
| 554 | | Sexplib0.Sexp.Atom ("banana" | "Banana") as sexp__109_ -> |
| 555 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__108_ sexp__109_ |
| 556 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("orange" | "Orange") :: _) as sexp__109_ -> |
| 557 | Sexplib0.Sexp_conv_error.stag_no_args error_source__108_ sexp__109_ |
| 558 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__107_ -> |
| 559 | Sexplib0.Sexp_conv_error.nested_list_invalid_sum error_source__108_ sexp__107_ |
| 560 | | Sexplib0.Sexp.List [] as sexp__107_ -> |
| 561 | Sexplib0.Sexp_conv_error.empty_list_invalid_sum error_source__108_ sexp__107_ |
| 562 | | sexp__107_ -> |
| 563 | Sexplib0.Sexp_conv_error.unexpected_stag error_source__108_ sexp__107_ |
| 564 | : Sexplib0.Sexp.t -> t) |
| 565 | ;; |
| 566 | |
| 567 | let _ = t_of_sexp |
| 568 | |
| 569 | let rec sexp_of_t = |
| 570 | (function |
| 571 | | Banana arg0__115_ -> |
| 572 | let res0__116_ = sexp_of_t arg0__115_ in |
| 573 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "Banana"; res0__116_ ] |
| 574 | | Orange -> Sexplib0.Sexp.Atom "Orange" |
| 575 | : t -> Sexplib0.Sexp.t) |
| 576 | ;; |
| 577 | |
| 578 | let _ = sexp_of_t |
| 579 | |
| 580 | [@@@end] |
| 581 | end |
| 582 | |
| 583 | module Nonrecursive = struct |
| 584 | open Recursive |
| 585 | |
| 586 | type nonrec t = t [@@deriving_inline sexp] |
| 587 | |
| 588 | let _ = fun (_ : t) -> () |
| 589 | let t_of_sexp = (t_of_sexp : Sexplib0.Sexp.t -> t) |
| 590 | let _ = t_of_sexp |
| 591 | let sexp_of_t = (sexp_of_t : t -> Sexplib0.Sexp.t) |
| 592 | let _ = sexp_of_t |
| 593 | |
| 594 | [@@@end] |
| 595 | end |
| 596 | |
| 597 | module Mutually_recursive = struct |
| 598 | type a = |
| 599 | | A |
| 600 | | B of b |
| 601 | | C of |
| 602 | { a : a |
| 603 | ; b : b |
| 604 | ; c : c |
| 605 | } |
| 606 | |
| 607 | and b = |
| 608 | { a : a |
| 609 | ; b : b |
| 610 | } |
| 611 | |
| 612 | and c = a [@@deriving_inline sexp] |
| 613 | |
| 614 | let _ = fun (_ : a) -> () |
| 615 | let _ = fun (_ : b) -> () |
| 616 | let _ = fun (_ : c) -> () |
| 617 | |
| 618 | let rec a_of_sexp = |
| 619 | (let error_source__120_ = "expansion.ml.Mutually_recursive.a" in |
| 620 | function |
| 621 | | Sexplib0.Sexp.Atom ("a" | "A") -> A |
| 622 | | Sexplib0.Sexp.List |
| 623 | (Sexplib0.Sexp.Atom (("b" | "B") as _tag__123_) :: sexp_args__124_) as |
| 624 | _sexp__122_ -> |
| 625 | (match sexp_args__124_ with |
| 626 | | [ arg0__125_ ] -> |
| 627 | let res0__126_ = b_of_sexp arg0__125_ in |
| 628 | B res0__126_ |
| 629 | | _ -> |
| 630 | Sexplib0.Sexp_conv_error.stag_incorrect_n_args |
| 631 | error_source__120_ |
| 632 | _tag__123_ |
| 633 | _sexp__122_) |
| 634 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("c" | "C") :: sexps__128_) as sexp__127_ -> |
| 635 | Sexplib0.Sexp_conv_record.record_of_sexps |
| 636 | ~context:sexp__127_ |
| 637 | ~caller:error_source__120_ |
| 638 | ~fields: |
| 639 | (Field |
| 640 | { name = "a" |
| 641 | ; kind = Required |
| 642 | ; conv = a_of_sexp |
| 643 | ; rest = |
| 644 | Field |
| 645 | { name = "b" |
| 646 | ; kind = Required |
| 647 | ; conv = b_of_sexp |
| 648 | ; rest = |
| 649 | Field |
| 650 | { name = "c"; kind = Required; conv = c_of_sexp; rest = Empty } |
| 651 | } |
| 652 | }) |
| 653 | ~index_of_field:(function |
| 654 | | "a" -> 0 |
| 655 | | "b" -> 1 |
| 656 | | "c" -> 2 |
| 657 | | _ -> -1) |
| 658 | ~allow_extra_fields:false |
| 659 | ~create:(fun (a, (b, (c, ()))) : a -> C { a; b; c }) |
| 660 | sexps__128_ |
| 661 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("a" | "A") :: _) as sexp__121_ -> |
| 662 | Sexplib0.Sexp_conv_error.stag_no_args error_source__120_ sexp__121_ |
| 663 | | Sexplib0.Sexp.Atom ("b" | "B") as sexp__121_ -> |
| 664 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__120_ sexp__121_ |
| 665 | | Sexplib0.Sexp.Atom ("c" | "C") as sexp__121_ -> |
| 666 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__120_ sexp__121_ |
| 667 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__119_ -> |
| 668 | Sexplib0.Sexp_conv_error.nested_list_invalid_sum error_source__120_ sexp__119_ |
| 669 | | Sexplib0.Sexp.List [] as sexp__119_ -> |
| 670 | Sexplib0.Sexp_conv_error.empty_list_invalid_sum error_source__120_ sexp__119_ |
| 671 | | sexp__119_ -> |
| 672 | Sexplib0.Sexp_conv_error.unexpected_stag error_source__120_ sexp__119_ |
| 673 | : Sexplib0.Sexp.t -> a) |
| 674 | |
| 675 | and b_of_sexp = |
| 676 | (let error_source__130_ = "expansion.ml.Mutually_recursive.b" in |
| 677 | fun x__131_ -> |
| 678 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 679 | ~caller:error_source__130_ |
| 680 | ~fields: |
| 681 | (Field |
| 682 | { name = "a" |
| 683 | ; kind = Required |
| 684 | ; conv = a_of_sexp |
| 685 | ; rest = |
| 686 | Field { name = "b"; kind = Required; conv = b_of_sexp; rest = Empty } |
| 687 | }) |
| 688 | ~index_of_field:(function |
| 689 | | "a" -> 0 |
| 690 | | "b" -> 1 |
| 691 | | _ -> -1) |
| 692 | ~allow_extra_fields:false |
| 693 | ~create:(fun (a, (b, ())) : b -> { a; b }) |
| 694 | x__131_ |
| 695 | : Sexplib0.Sexp.t -> b) |
| 696 | |
| 697 | and c_of_sexp = (fun x__133_ -> a_of_sexp x__133_ : Sexplib0.Sexp.t -> c) |
| 698 | |
| 699 | let _ = a_of_sexp |
| 700 | and _ = b_of_sexp |
| 701 | and _ = c_of_sexp |
| 702 | |
| 703 | let rec sexp_of_a = |
| 704 | (function |
| 705 | | A -> Sexplib0.Sexp.Atom "A" |
| 706 | | B arg0__134_ -> |
| 707 | let res0__135_ = sexp_of_b arg0__134_ in |
| 708 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "B"; res0__135_ ] |
| 709 | | C { a = a__137_; b = b__139_; c = c__141_ } -> |
| 710 | let bnds__136_ = ([] : _ Stdlib.List.t) in |
| 711 | let bnds__136_ = |
| 712 | let arg__142_ = sexp_of_c c__141_ in |
| 713 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__142_ ] :: bnds__136_ |
| 714 | : _ Stdlib.List.t) |
| 715 | in |
| 716 | let bnds__136_ = |
| 717 | let arg__140_ = sexp_of_b b__139_ in |
| 718 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__140_ ] :: bnds__136_ |
| 719 | : _ Stdlib.List.t) |
| 720 | in |
| 721 | let bnds__136_ = |
| 722 | let arg__138_ = sexp_of_a a__137_ in |
| 723 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__138_ ] :: bnds__136_ |
| 724 | : _ Stdlib.List.t) |
| 725 | in |
| 726 | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom "C" :: bnds__136_) |
| 727 | : a -> Sexplib0.Sexp.t) |
| 728 | |
| 729 | and sexp_of_b = |
| 730 | (fun { a = a__144_; b = b__146_ } -> |
| 731 | let bnds__143_ = ([] : _ Stdlib.List.t) in |
| 732 | let bnds__143_ = |
| 733 | let arg__147_ = sexp_of_b b__146_ in |
| 734 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__147_ ] :: bnds__143_ |
| 735 | : _ Stdlib.List.t) |
| 736 | in |
| 737 | let bnds__143_ = |
| 738 | let arg__145_ = sexp_of_a a__144_ in |
| 739 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__145_ ] :: bnds__143_ |
| 740 | : _ Stdlib.List.t) |
| 741 | in |
| 742 | Sexplib0.Sexp.List bnds__143_ |
| 743 | : b -> Sexplib0.Sexp.t) |
| 744 | |
| 745 | and sexp_of_c = (fun x__148_ -> sexp_of_a x__148_ : c -> Sexplib0.Sexp.t) |
| 746 | |
| 747 | let _ = sexp_of_a |
| 748 | and _ = sexp_of_b |
| 749 | and _ = sexp_of_c |
| 750 | |
| 751 | [@@@end] |
| 752 | end |
| 753 | |
| 754 | module Alias = struct |
| 755 | type t = Recursive.t [@@deriving_inline sexp] |
| 756 | |
| 757 | let _ = fun (_ : t) -> () |
| 758 | let t_of_sexp = (Recursive.t_of_sexp : Sexplib0.Sexp.t -> t) |
| 759 | let _ = t_of_sexp |
| 760 | let sexp_of_t = (Recursive.sexp_of_t : t -> Sexplib0.Sexp.t) |
| 761 | let _ = sexp_of_t |
| 762 | |
| 763 | [@@@end] |
| 764 | end |
| 765 | |
| 766 | module Re_export = struct |
| 767 | type t = Recursive.t = |
| 768 | | Banana of t |
| 769 | | Orange |
| 770 | [@@deriving_inline sexp] |
| 771 | |
| 772 | let _ = fun (_ : t) -> () |
| 773 | |
| 774 | let rec t_of_sexp = |
| 775 | (let error_source__152_ = "expansion.ml.Re_export.t" in |
| 776 | function |
| 777 | | Sexplib0.Sexp.List |
| 778 | (Sexplib0.Sexp.Atom (("banana" | "Banana") as _tag__155_) :: sexp_args__156_) as |
| 779 | _sexp__154_ -> |
| 780 | (match sexp_args__156_ with |
| 781 | | [ arg0__157_ ] -> |
| 782 | let res0__158_ = t_of_sexp arg0__157_ in |
| 783 | Banana res0__158_ |
| 784 | | _ -> |
| 785 | Sexplib0.Sexp_conv_error.stag_incorrect_n_args |
| 786 | error_source__152_ |
| 787 | _tag__155_ |
| 788 | _sexp__154_) |
| 789 | | Sexplib0.Sexp.Atom ("orange" | "Orange") -> Orange |
| 790 | | Sexplib0.Sexp.Atom ("banana" | "Banana") as sexp__153_ -> |
| 791 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__152_ sexp__153_ |
| 792 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom ("orange" | "Orange") :: _) as sexp__153_ -> |
| 793 | Sexplib0.Sexp_conv_error.stag_no_args error_source__152_ sexp__153_ |
| 794 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__151_ -> |
| 795 | Sexplib0.Sexp_conv_error.nested_list_invalid_sum error_source__152_ sexp__151_ |
| 796 | | Sexplib0.Sexp.List [] as sexp__151_ -> |
| 797 | Sexplib0.Sexp_conv_error.empty_list_invalid_sum error_source__152_ sexp__151_ |
| 798 | | sexp__151_ -> |
| 799 | Sexplib0.Sexp_conv_error.unexpected_stag error_source__152_ sexp__151_ |
| 800 | : Sexplib0.Sexp.t -> t) |
| 801 | ;; |
| 802 | |
| 803 | let _ = t_of_sexp |
| 804 | |
| 805 | let rec sexp_of_t = |
| 806 | (function |
| 807 | | Banana arg0__159_ -> |
| 808 | let res0__160_ = sexp_of_t arg0__159_ in |
| 809 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "Banana"; res0__160_ ] |
| 810 | | Orange -> Sexplib0.Sexp.Atom "Orange" |
| 811 | : t -> Sexplib0.Sexp.t) |
| 812 | ;; |
| 813 | |
| 814 | let _ = sexp_of_t |
| 815 | |
| 816 | [@@@end] |
| 817 | end |
| 818 | |
| 819 | module Unary = struct |
| 820 | type 'a t = 'a list option [@@deriving_inline sexp] |
| 821 | |
| 822 | let _ = fun (_ : 'a t) -> () |
| 823 | |
| 824 | let t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t = |
| 825 | fun _of_a__161_ x__163_ -> option_of_sexp (list_of_sexp _of_a__161_) x__163_ |
| 826 | ;; |
| 827 | |
| 828 | let _ = t_of_sexp |
| 829 | |
| 830 | let sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t = |
| 831 | fun _of_a__164_ x__165_ -> sexp_of_option (sexp_of_list _of_a__164_) x__165_ |
| 832 | ;; |
| 833 | |
| 834 | let _ = sexp_of_t |
| 835 | |
| 836 | [@@@end] |
| 837 | end |
| 838 | |
| 839 | module Binary = struct |
| 840 | type ('a, 'b) t = ('a, 'b) Either.t [@@deriving_inline sexp] |
| 841 | |
| 842 | let _ = fun (_ : ('a, 'b) t) -> () |
| 843 | |
| 844 | let t_of_sexp : |
| 845 | 'a 'b. |
| 846 | (Sexplib0.Sexp.t -> 'a) |
| 847 | -> (Sexplib0.Sexp.t -> 'b) |
| 848 | -> Sexplib0.Sexp.t |
| 849 | -> ('a, 'b) t |
| 850 | = |
| 851 | Either.t_of_sexp |
| 852 | ;; |
| 853 | |
| 854 | let _ = t_of_sexp |
| 855 | |
| 856 | let sexp_of_t : |
| 857 | 'a 'b. |
| 858 | ('a -> Sexplib0.Sexp.t) |
| 859 | -> ('b -> Sexplib0.Sexp.t) |
| 860 | -> ('a, 'b) t |
| 861 | -> Sexplib0.Sexp.t |
| 862 | = |
| 863 | Either.sexp_of_t |
| 864 | ;; |
| 865 | |
| 866 | let _ = sexp_of_t |
| 867 | |
| 868 | [@@@end] |
| 869 | end |
| 870 | |
| 871 | module First_order = struct |
| 872 | type 'a t = 'a -> 'a [@@deriving_inline sexp] |
| 873 | |
| 874 | let _ = fun (_ : 'a t) -> () |
| 875 | |
| 876 | let t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t = |
| 877 | fun _of_a__173_ -> Sexplib0.Sexp_conv.fun_of_sexp |
| 878 | ;; |
| 879 | |
| 880 | let _ = t_of_sexp |
| 881 | |
| 882 | let sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t = |
| 883 | fun _of_a__175_ _ -> Sexplib0.Sexp_conv.sexp_of_fun Sexplib0.Sexp_conv.ignore |
| 884 | ;; |
| 885 | |
| 886 | let _ = sexp_of_t |
| 887 | |
| 888 | [@@@end] |
| 889 | end |
| 890 | |
| 891 | module Second_order = struct |
| 892 | type ('a, 'b) t = ('a -> 'a) -> ('a -> 'b) -> ('b -> 'b) -> 'a -> 'b |
| 893 | [@@deriving_inline sexp] |
| 894 | |
| 895 | let _ = fun (_ : ('a, 'b) t) -> () |
| 896 | |
| 897 | let t_of_sexp : |
| 898 | 'a 'b. |
| 899 | (Sexplib0.Sexp.t -> 'a) |
| 900 | -> (Sexplib0.Sexp.t -> 'b) |
| 901 | -> Sexplib0.Sexp.t |
| 902 | -> ('a, 'b) t |
| 903 | = |
| 904 | fun _of_a__176_ _of_b__177_ -> Sexplib0.Sexp_conv.fun_of_sexp |
| 905 | ;; |
| 906 | |
| 907 | let _ = t_of_sexp |
| 908 | |
| 909 | let sexp_of_t : |
| 910 | 'a 'b. |
| 911 | ('a -> Sexplib0.Sexp.t) |
| 912 | -> ('b -> Sexplib0.Sexp.t) |
| 913 | -> ('a, 'b) t |
| 914 | -> Sexplib0.Sexp.t |
| 915 | = |
| 916 | fun _of_a__179_ _of_b__180_ _ -> |
| 917 | Sexplib0.Sexp_conv.sexp_of_fun Sexplib0.Sexp_conv.ignore |
| 918 | ;; |
| 919 | |
| 920 | let _ = sexp_of_t |
| 921 | |
| 922 | [@@@end] |
| 923 | end |
| 924 | |
| 925 | module Named_arguments = struct |
| 926 | type t = ?a:int -> b:int -> int -> int [@@deriving_inline sexp] |
| 927 | |
| 928 | let _ = fun (_ : t) -> () |
| 929 | let t_of_sexp = (Sexplib0.Sexp_conv.fun_of_sexp : Sexplib0.Sexp.t -> t) |
| 930 | let _ = t_of_sexp |
| 931 | |
| 932 | let sexp_of_t = |
| 933 | (fun _ -> Sexplib0.Sexp_conv.sexp_of_fun Sexplib0.Sexp_conv.ignore |
| 934 | : t -> Sexplib0.Sexp.t) |
| 935 | ;; |
| 936 | |
| 937 | let _ = sexp_of_t |
| 938 | |
| 939 | [@@@end] |
| 940 | end |
| 941 | |
| 942 | module Gadt = struct |
| 943 | type _ t = |
| 944 | | A : _ option t |
| 945 | | B : int -> int t |
| 946 | | C : 'a list -> unit t |
| 947 | [@@deriving_inline sexp_of] |
| 948 | |
| 949 | let _ = fun (_ : _ t) -> () |
| 950 | |
| 951 | let sexp_of_t : 'a__182_. ('a__182_ -> Sexplib0.Sexp.t) -> 'a__182_ t -> Sexplib0.Sexp.t |
| 952 | = |
| 953 | fun (type a__188_) : ((a__188_ -> Sexplib0.Sexp.t) -> a__188_ t -> Sexplib0.Sexp.t) -> |
| 954 | fun _of_a__183_ -> function |
| 955 | | A -> Sexplib0.Sexp.Atom "A" |
| 956 | | B arg0__184_ -> |
| 957 | let res0__185_ = sexp_of_int arg0__184_ in |
| 958 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "B"; res0__185_ ] |
| 959 | | C arg0__186_ -> |
| 960 | let res0__187_ = sexp_of_list (fun _ -> Sexplib0.Sexp.Atom "_") arg0__186_ in |
| 961 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "C"; res0__187_ ] |
| 962 | ;; |
| 963 | |
| 964 | let _ = sexp_of_t |
| 965 | |
| 966 | [@@@end] |
| 967 | end |
| 968 | |
| 969 | module Recursive_record_containing_variant = struct |
| 970 | type t = |
| 971 | { a : [ `A of t ] |
| 972 | ; b : [ `B ] [@sexp_drop_default Poly.equal] [@default `B] |
| 973 | } |
| 974 | [@@deriving_inline sexp] |
| 975 | |
| 976 | let _ = fun (_ : t) -> () |
| 977 | |
| 978 | let rec t_of_sexp = |
| 979 | (let (default__191_ : [ `B ]) = `B in |
| 980 | let error_source__190_ = "expansion.ml.Recursive_record_containing_variant.t" in |
| 981 | fun x__207_ -> |
| 982 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 983 | ~caller:error_source__190_ |
| 984 | ~fields: |
| 985 | (Field |
| 986 | { name = "a" |
| 987 | ; kind = Required |
| 988 | ; conv = |
| 989 | (fun sexp__206_ -> |
| 990 | try |
| 991 | match sexp__206_ with |
| 992 | | Sexplib0.Sexp.Atom atom__199_ as _sexp__201_ -> |
| 993 | (match atom__199_ with |
| 994 | | "A" -> |
| 995 | Sexplib0.Sexp_conv_error.ptag_takes_args |
| 996 | error_source__190_ |
| 997 | _sexp__201_ |
| 998 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 999 | | Sexplib0.Sexp.List |
| 1000 | (Sexplib0.Sexp.Atom atom__199_ :: sexp_args__202_) as |
| 1001 | _sexp__201_ -> |
| 1002 | (match atom__199_ with |
| 1003 | | "A" as _tag__203_ -> |
| 1004 | (match sexp_args__202_ with |
| 1005 | | [ arg0__204_ ] -> |
| 1006 | let res0__205_ = t_of_sexp arg0__204_ in |
| 1007 | `A res0__205_ |
| 1008 | | _ -> |
| 1009 | Sexplib0.Sexp_conv_error.ptag_incorrect_n_args |
| 1010 | error_source__190_ |
| 1011 | _tag__203_ |
| 1012 | _sexp__201_) |
| 1013 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 1014 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__200_ -> |
| 1015 | Sexplib0.Sexp_conv_error.nested_list_invalid_poly_var |
| 1016 | error_source__190_ |
| 1017 | sexp__200_ |
| 1018 | | Sexplib0.Sexp.List [] as sexp__200_ -> |
| 1019 | Sexplib0.Sexp_conv_error.empty_list_invalid_poly_var |
| 1020 | error_source__190_ |
| 1021 | sexp__200_ |
| 1022 | with |
| 1023 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 1024 | Sexplib0.Sexp_conv_error.no_matching_variant_found |
| 1025 | error_source__190_ |
| 1026 | sexp__206_) |
| 1027 | ; rest = |
| 1028 | Field |
| 1029 | { name = "b" |
| 1030 | ; kind = Default (fun () -> default__191_) |
| 1031 | ; conv = |
| 1032 | (fun sexp__197_ -> |
| 1033 | try |
| 1034 | match sexp__197_ with |
| 1035 | | Sexplib0.Sexp.Atom atom__193_ as _sexp__195_ -> |
| 1036 | (match atom__193_ with |
| 1037 | | "B" -> `B |
| 1038 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 1039 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom atom__193_ :: _) as |
| 1040 | _sexp__195_ -> |
| 1041 | (match atom__193_ with |
| 1042 | | "B" -> |
| 1043 | Sexplib0.Sexp_conv_error.ptag_no_args |
| 1044 | error_source__190_ |
| 1045 | _sexp__195_ |
| 1046 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 1047 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__194_ |
| 1048 | -> |
| 1049 | Sexplib0.Sexp_conv_error.nested_list_invalid_poly_var |
| 1050 | error_source__190_ |
| 1051 | sexp__194_ |
| 1052 | | Sexplib0.Sexp.List [] as sexp__194_ -> |
| 1053 | Sexplib0.Sexp_conv_error.empty_list_invalid_poly_var |
| 1054 | error_source__190_ |
| 1055 | sexp__194_ |
| 1056 | with |
| 1057 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 1058 | Sexplib0.Sexp_conv_error.no_matching_variant_found |
| 1059 | error_source__190_ |
| 1060 | sexp__197_) |
| 1061 | ; rest = Empty |
| 1062 | } |
| 1063 | }) |
| 1064 | ~index_of_field:(function |
| 1065 | | "a" -> 0 |
| 1066 | | "b" -> 1 |
| 1067 | | _ -> -1) |
| 1068 | ~allow_extra_fields:false |
| 1069 | ~create:(fun (a, (b, ())) : t -> { a; b }) |
| 1070 | x__207_ |
| 1071 | : Sexplib0.Sexp.t -> t) |
| 1072 | ;; |
| 1073 | |
| 1074 | let _ = t_of_sexp |
| 1075 | |
| 1076 | let rec sexp_of_t = |
| 1077 | (let (default__214_ : [ `B ]) = `B |
| 1078 | and (drop_default__213_ : [ `B ] -> [ `B ] -> Stdlib.Bool.t) = Poly.equal in |
| 1079 | fun { a = a__209_; b = b__215_ } -> |
| 1080 | let bnds__208_ = ([] : _ Stdlib.List.t) in |
| 1081 | let bnds__208_ = |
| 1082 | if drop_default__213_ default__214_ b__215_ |
| 1083 | then bnds__208_ |
| 1084 | else ( |
| 1085 | let arg__217_ = (fun `B -> Sexplib0.Sexp.Atom "B") b__215_ in |
| 1086 | let bnd__216_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__217_ ] in |
| 1087 | (bnd__216_ :: bnds__208_ : _ Stdlib.List.t)) |
| 1088 | in |
| 1089 | let bnds__208_ = |
| 1090 | let arg__210_ = |
| 1091 | let (`A v__211_) = a__209_ in |
| 1092 | Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "A"; sexp_of_t v__211_ ] |
| 1093 | in |
| 1094 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__210_ ] :: bnds__208_ |
| 1095 | : _ Stdlib.List.t) |
| 1096 | in |
| 1097 | Sexplib0.Sexp.List bnds__208_ |
| 1098 | : t -> Sexplib0.Sexp.t) |
| 1099 | ;; |
| 1100 | |
| 1101 | let _ = sexp_of_t |
| 1102 | |
| 1103 | [@@@end] |
| 1104 | end |
| 1105 | |
| 1106 | module Poly_record = struct |
| 1107 | type t = |
| 1108 | { a : 'a. 'a list |
| 1109 | ; b : 'b. 'b option |
| 1110 | ; c : 'c. 'c |
| 1111 | } |
| 1112 | [@@deriving_inline sexp] |
| 1113 | |
| 1114 | let _ = fun (_ : t) -> () |
| 1115 | |
| 1116 | let t_of_sexp = |
| 1117 | (let error_source__219_ = "expansion.ml.Poly_record.t" in |
| 1118 | fun x__229_ -> |
| 1119 | let open struct |
| 1120 | type a__220_ = { a__220_ : 'a. 'a list } [@@unboxed] |
| 1121 | type b__221_ = { b__221_ : 'b. 'b option } [@@unboxed] |
| 1122 | type c__222_ = { c__222_ : 'c. 'c } [@@unboxed] |
| 1123 | end in |
| 1124 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 1125 | ~caller:error_source__219_ |
| 1126 | ~fields: |
| 1127 | (Field |
| 1128 | { name = "a" |
| 1129 | ; kind = Required |
| 1130 | ; conv = |
| 1131 | (fun sexp__227_ -> |
| 1132 | { a__220_ = |
| 1133 | (let _a__228_ = |
| 1134 | Sexplib0.Sexp_conv_error.record_poly_field_value |
| 1135 | error_source__219_ |
| 1136 | in |
| 1137 | list_of_sexp _a__228_ sexp__227_) |
| 1138 | }) |
| 1139 | ; rest = |
| 1140 | Field |
| 1141 | { name = "b" |
| 1142 | ; kind = Required |
| 1143 | ; conv = |
| 1144 | (fun sexp__225_ -> |
| 1145 | { b__221_ = |
| 1146 | (let _b__226_ = |
| 1147 | Sexplib0.Sexp_conv_error.record_poly_field_value |
| 1148 | error_source__219_ |
| 1149 | in |
| 1150 | option_of_sexp _b__226_ sexp__225_) |
| 1151 | }) |
| 1152 | ; rest = |
| 1153 | Field |
| 1154 | { name = "c" |
| 1155 | ; kind = Required |
| 1156 | ; conv = |
| 1157 | (fun sexp__223_ -> |
| 1158 | { c__222_ = |
| 1159 | (let _c__224_ = |
| 1160 | Sexplib0.Sexp_conv_error.record_poly_field_value |
| 1161 | error_source__219_ |
| 1162 | in |
| 1163 | _c__224_ sexp__223_) |
| 1164 | }) |
| 1165 | ; rest = Empty |
| 1166 | } |
| 1167 | } |
| 1168 | }) |
| 1169 | ~index_of_field:(function |
| 1170 | | "a" -> 0 |
| 1171 | | "b" -> 1 |
| 1172 | | "c" -> 2 |
| 1173 | | _ -> -1) |
| 1174 | ~allow_extra_fields:false |
| 1175 | ~create:(fun ({ a__220_ = a }, ({ b__221_ = b }, ({ c__222_ = c }, ()))) : t -> |
| 1176 | { a; b; c }) |
| 1177 | x__229_ |
| 1178 | : Sexplib0.Sexp.t -> t) |
| 1179 | ;; |
| 1180 | |
| 1181 | let _ = t_of_sexp |
| 1182 | |
| 1183 | let sexp_of_t = |
| 1184 | (fun { a = a__231_; b = b__234_; c = c__237_ } -> |
| 1185 | let bnds__230_ = ([] : _ Stdlib.List.t) in |
| 1186 | let bnds__230_ = |
| 1187 | let arg__238_ = |
| 1188 | let _of_c__239_ = Sexplib0.Sexp_conv.sexp_of_opaque in |
| 1189 | _of_c__239_ c__237_ |
| 1190 | in |
| 1191 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__238_ ] :: bnds__230_ |
| 1192 | : _ Stdlib.List.t) |
| 1193 | in |
| 1194 | let bnds__230_ = |
| 1195 | let arg__235_ = |
| 1196 | let _of_b__236_ = Sexplib0.Sexp_conv.sexp_of_opaque in |
| 1197 | sexp_of_option _of_b__236_ b__234_ |
| 1198 | in |
| 1199 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__235_ ] :: bnds__230_ |
| 1200 | : _ Stdlib.List.t) |
| 1201 | in |
| 1202 | let bnds__230_ = |
| 1203 | let arg__232_ = |
| 1204 | let _of_a__233_ = Sexplib0.Sexp_conv.sexp_of_opaque in |
| 1205 | sexp_of_list _of_a__233_ a__231_ |
| 1206 | in |
| 1207 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__232_ ] :: bnds__230_ |
| 1208 | : _ Stdlib.List.t) |
| 1209 | in |
| 1210 | Sexplib0.Sexp.List bnds__230_ |
| 1211 | : t -> Sexplib0.Sexp.t) |
| 1212 | ;; |
| 1213 | |
| 1214 | let _ = sexp_of_t |
| 1215 | |
| 1216 | [@@@end] |
| 1217 | end |
| 1218 | |
| 1219 | module Record_with_defaults = struct |
| 1220 | type t = |
| 1221 | { a : int [@default 0] |
| 1222 | ; b : int [@default 0] [@sexp_drop_default.compare] |
| 1223 | ; c : int [@default 0] [@sexp_drop_default.equal] |
| 1224 | ; d : int [@default 0] [@sexp_drop_default.sexp] |
| 1225 | ; e : int [@default 0] [@sexp_drop_default ( = )] |
| 1226 | ; f : int [@sexp_drop_if ( = ) 0] |
| 1227 | } |
| 1228 | [@@deriving_inline sexp] |
| 1229 | |
| 1230 | let _ = fun (_ : t) -> () |
| 1231 | |
| 1232 | let t_of_sexp = |
| 1233 | (let (default__242_ : int) = 0 |
| 1234 | and (default__243_ : int) = 0 |
| 1235 | and (default__244_ : int) = 0 |
| 1236 | and (default__245_ : int) = 0 |
| 1237 | and (default__246_ : int) = 0 in |
| 1238 | let error_source__241_ = "expansion.ml.Record_with_defaults.t" in |
| 1239 | fun x__247_ -> |
| 1240 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 1241 | ~caller:error_source__241_ |
| 1242 | ~fields: |
| 1243 | (Field |
| 1244 | { name = "a" |
| 1245 | ; kind = Default (fun () -> default__246_) |
| 1246 | ; conv = int_of_sexp |
| 1247 | ; rest = |
| 1248 | Field |
| 1249 | { name = "b" |
| 1250 | ; kind = Default (fun () -> default__245_) |
| 1251 | ; conv = int_of_sexp |
| 1252 | ; rest = |
| 1253 | Field |
| 1254 | { name = "c" |
| 1255 | ; kind = Default (fun () -> default__244_) |
| 1256 | ; conv = int_of_sexp |
| 1257 | ; rest = |
| 1258 | Field |
| 1259 | { name = "d" |
| 1260 | ; kind = Default (fun () -> default__243_) |
| 1261 | ; conv = int_of_sexp |
| 1262 | ; rest = |
| 1263 | Field |
| 1264 | { name = "e" |
| 1265 | ; kind = Default (fun () -> default__242_) |
| 1266 | ; conv = int_of_sexp |
| 1267 | ; rest = |
| 1268 | Field |
| 1269 | { name = "f" |
| 1270 | ; kind = Required |
| 1271 | ; conv = int_of_sexp |
| 1272 | ; rest = Empty |
| 1273 | } |
| 1274 | } |
| 1275 | } |
| 1276 | } |
| 1277 | } |
| 1278 | }) |
| 1279 | ~index_of_field:(function |
| 1280 | | "a" -> 0 |
| 1281 | | "b" -> 1 |
| 1282 | | "c" -> 2 |
| 1283 | | "d" -> 3 |
| 1284 | | "e" -> 4 |
| 1285 | | "f" -> 5 |
| 1286 | | _ -> -1) |
| 1287 | ~allow_extra_fields:false |
| 1288 | ~create:(fun (a, (b, (c, (d, (e, (f, ())))))) : t -> { a; b; c; d; e; f }) |
| 1289 | x__247_ |
| 1290 | : Sexplib0.Sexp.t -> t) |
| 1291 | ;; |
| 1292 | |
| 1293 | let _ = t_of_sexp |
| 1294 | |
| 1295 | let sexp_of_t = |
| 1296 | (let (default__252_ : int) = 0 |
| 1297 | and (default__257_ : int) = 0 |
| 1298 | and (default__262_ : int) = 0 |
| 1299 | and (default__268_ : int) = 0 |
| 1300 | and (drop_default__267_ : int -> int -> Stdlib.Bool.t) = ( = ) |
| 1301 | and (drop_if__273_ : Stdlib.Unit.t -> int -> Stdlib.Bool.t) = fun () -> ( = ) 0 in |
| 1302 | fun { a = a__249_; b = b__253_; c = c__258_; d = d__263_; e = e__269_; f = f__274_ } -> |
| 1303 | let bnds__248_ = ([] : _ Stdlib.List.t) in |
| 1304 | let bnds__248_ = |
| 1305 | if (drop_if__273_ ()) f__274_ |
| 1306 | then bnds__248_ |
| 1307 | else ( |
| 1308 | let arg__276_ = sexp_of_int f__274_ in |
| 1309 | let bnd__275_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "f"; arg__276_ ] in |
| 1310 | (bnd__275_ :: bnds__248_ : _ Stdlib.List.t)) |
| 1311 | in |
| 1312 | let bnds__248_ = |
| 1313 | if drop_default__267_ default__268_ e__269_ |
| 1314 | then bnds__248_ |
| 1315 | else ( |
| 1316 | let arg__271_ = sexp_of_int e__269_ in |
| 1317 | let bnd__270_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "e"; arg__271_ ] in |
| 1318 | (bnd__270_ :: bnds__248_ : _ Stdlib.List.t)) |
| 1319 | in |
| 1320 | let bnds__248_ = |
| 1321 | let arg__265_ = sexp_of_int d__263_ in |
| 1322 | if Sexplib0.Sexp_conv.( = ) (sexp_of_int default__262_) arg__265_ |
| 1323 | then bnds__248_ |
| 1324 | else ( |
| 1325 | let bnd__264_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "d"; arg__265_ ] in |
| 1326 | (bnd__264_ :: bnds__248_ : _ Stdlib.List.t)) |
| 1327 | in |
| 1328 | let bnds__248_ = |
| 1329 | if [%equal: int] default__257_ c__258_ |
| 1330 | then bnds__248_ |
| 1331 | else ( |
| 1332 | let arg__260_ = sexp_of_int c__258_ in |
| 1333 | let bnd__259_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__260_ ] in |
| 1334 | (bnd__259_ :: bnds__248_ : _ Stdlib.List.t)) |
| 1335 | in |
| 1336 | let bnds__248_ = |
| 1337 | if [%compare.equal: int] default__252_ b__253_ |
| 1338 | then bnds__248_ |
| 1339 | else ( |
| 1340 | let arg__255_ = sexp_of_int b__253_ in |
| 1341 | let bnd__254_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__255_ ] in |
| 1342 | (bnd__254_ :: bnds__248_ : _ Stdlib.List.t)) |
| 1343 | in |
| 1344 | let bnds__248_ = |
| 1345 | let arg__250_ = sexp_of_int a__249_ in |
| 1346 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__250_ ] :: bnds__248_ |
| 1347 | : _ Stdlib.List.t) |
| 1348 | in |
| 1349 | Sexplib0.Sexp.List bnds__248_ |
| 1350 | : t -> Sexplib0.Sexp.t) |
| 1351 | ;; |
| 1352 | |
| 1353 | let _ = sexp_of_t |
| 1354 | |
| 1355 | [@@@end] |
| 1356 | end |
| 1357 | |
| 1358 | module Record_with_special_types = struct |
| 1359 | type t = |
| 1360 | { a : int option [@sexp.option] |
| 1361 | ; b : int list [@sexp.list] |
| 1362 | ; c : int array [@sexp.array] |
| 1363 | ; d : bool [@sexp.bool] |
| 1364 | } |
| 1365 | [@@deriving_inline sexp] |
| 1366 | |
| 1367 | let _ = fun (_ : t) -> () |
| 1368 | |
| 1369 | let t_of_sexp = |
| 1370 | (let error_source__284_ = "expansion.ml.Record_with_special_types.t" in |
| 1371 | fun x__285_ -> |
| 1372 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 1373 | ~caller:error_source__284_ |
| 1374 | ~fields: |
| 1375 | (Field |
| 1376 | { name = "a" |
| 1377 | ; kind = Sexp_option |
| 1378 | ; conv = int_of_sexp |
| 1379 | ; rest = |
| 1380 | Field |
| 1381 | { name = "b" |
| 1382 | ; kind = Sexp_list |
| 1383 | ; conv = int_of_sexp |
| 1384 | ; rest = |
| 1385 | Field |
| 1386 | { name = "c" |
| 1387 | ; kind = Sexp_array |
| 1388 | ; conv = int_of_sexp |
| 1389 | ; rest = |
| 1390 | Field |
| 1391 | { name = "d"; kind = Sexp_bool; conv = (); rest = Empty } |
| 1392 | } |
| 1393 | } |
| 1394 | }) |
| 1395 | ~index_of_field:(function |
| 1396 | | "a" -> 0 |
| 1397 | | "b" -> 1 |
| 1398 | | "c" -> 2 |
| 1399 | | "d" -> 3 |
| 1400 | | _ -> -1) |
| 1401 | ~allow_extra_fields:false |
| 1402 | ~create:(fun (a, (b, (c, (d, ())))) : t -> { a; b; c; d }) |
| 1403 | x__285_ |
| 1404 | : Sexplib0.Sexp.t -> t) |
| 1405 | ;; |
| 1406 | |
| 1407 | let _ = t_of_sexp |
| 1408 | |
| 1409 | let sexp_of_t = |
| 1410 | (fun { a = a__287_; b = b__292_; c = c__296_; d = d__299_ } -> |
| 1411 | let bnds__286_ = ([] : _ Stdlib.List.t) in |
| 1412 | let bnds__286_ = |
| 1413 | if d__299_ |
| 1414 | then ( |
| 1415 | let bnd__300_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "d" ] in |
| 1416 | (bnd__300_ :: bnds__286_ : _ Stdlib.List.t)) |
| 1417 | else bnds__286_ |
| 1418 | in |
| 1419 | let bnds__286_ = |
| 1420 | if match c__296_ with |
| 1421 | | [||] -> true |
| 1422 | | _ -> false |
| 1423 | then bnds__286_ |
| 1424 | else ( |
| 1425 | let arg__298_ = (sexp_of_array sexp_of_int) c__296_ in |
| 1426 | let bnd__297_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__298_ ] in |
| 1427 | (bnd__297_ :: bnds__286_ : _ Stdlib.List.t)) |
| 1428 | in |
| 1429 | let bnds__286_ = |
| 1430 | if match b__292_ with |
| 1431 | | [] -> true |
| 1432 | | _ -> false |
| 1433 | then bnds__286_ |
| 1434 | else ( |
| 1435 | let arg__294_ = (sexp_of_list sexp_of_int) b__292_ in |
| 1436 | let bnd__293_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__294_ ] in |
| 1437 | (bnd__293_ :: bnds__286_ : _ Stdlib.List.t)) |
| 1438 | in |
| 1439 | let bnds__286_ = |
| 1440 | match a__287_ with |
| 1441 | | Stdlib.Option.None -> bnds__286_ |
| 1442 | | Stdlib.Option.Some v__288_ -> |
| 1443 | let arg__290_ = sexp_of_int v__288_ in |
| 1444 | let bnd__289_ = Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__290_ ] in |
| 1445 | (bnd__289_ :: bnds__286_ : _ Stdlib.List.t) |
| 1446 | in |
| 1447 | Sexplib0.Sexp.List bnds__286_ |
| 1448 | : t -> Sexplib0.Sexp.t) |
| 1449 | ;; |
| 1450 | |
| 1451 | let _ = sexp_of_t |
| 1452 | |
| 1453 | [@@@end] |
| 1454 | end |
| 1455 | |
| 1456 | module Record_with_omit_nil = struct |
| 1457 | type t = |
| 1458 | { a : int option [@sexp.omit_nil] |
| 1459 | ; b : int list [@sexp.omit_nil] |
| 1460 | ; c : unit [@sexp.omit_nil] |
| 1461 | ; d : int [@sexp.omit_nil] |
| 1462 | } |
| 1463 | [@@deriving_inline sexp] |
| 1464 | |
| 1465 | let _ = fun (_ : t) -> () |
| 1466 | |
| 1467 | let t_of_sexp = |
| 1468 | (let error_source__302_ = "expansion.ml.Record_with_omit_nil.t" in |
| 1469 | fun x__303_ -> |
| 1470 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 1471 | ~caller:error_source__302_ |
| 1472 | ~fields: |
| 1473 | (Field |
| 1474 | { name = "a" |
| 1475 | ; kind = Omit_nil |
| 1476 | ; conv = option_of_sexp int_of_sexp |
| 1477 | ; rest = |
| 1478 | Field |
| 1479 | { name = "b" |
| 1480 | ; kind = Omit_nil |
| 1481 | ; conv = list_of_sexp int_of_sexp |
| 1482 | ; rest = |
| 1483 | Field |
| 1484 | { name = "c" |
| 1485 | ; kind = Omit_nil |
| 1486 | ; conv = unit_of_sexp |
| 1487 | ; rest = |
| 1488 | Field |
| 1489 | { name = "d" |
| 1490 | ; kind = Omit_nil |
| 1491 | ; conv = int_of_sexp |
| 1492 | ; rest = Empty |
| 1493 | } |
| 1494 | } |
| 1495 | } |
| 1496 | }) |
| 1497 | ~index_of_field:(function |
| 1498 | | "a" -> 0 |
| 1499 | | "b" -> 1 |
| 1500 | | "c" -> 2 |
| 1501 | | "d" -> 3 |
| 1502 | | _ -> -1) |
| 1503 | ~allow_extra_fields:false |
| 1504 | ~create:(fun (a, (b, (c, (d, ())))) : t -> { a; b; c; d }) |
| 1505 | x__303_ |
| 1506 | : Sexplib0.Sexp.t -> t) |
| 1507 | ;; |
| 1508 | |
| 1509 | let _ = t_of_sexp |
| 1510 | |
| 1511 | let sexp_of_t = |
| 1512 | (fun { a = a__305_; b = b__307_; c = c__309_; d = d__311_ } -> |
| 1513 | let bnds__304_ = ([] : _ Stdlib.List.t) in |
| 1514 | let bnds__304_ = |
| 1515 | match sexp_of_int d__311_ with |
| 1516 | | Sexplib0.Sexp.List [] -> bnds__304_ |
| 1517 | | arg__312_ -> |
| 1518 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "d"; arg__312_ ] :: bnds__304_ |
| 1519 | : _ Stdlib.List.t) |
| 1520 | in |
| 1521 | let bnds__304_ = |
| 1522 | match sexp_of_unit c__309_ with |
| 1523 | | Sexplib0.Sexp.List [] -> bnds__304_ |
| 1524 | | arg__310_ -> |
| 1525 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "c"; arg__310_ ] :: bnds__304_ |
| 1526 | : _ Stdlib.List.t) |
| 1527 | in |
| 1528 | let bnds__304_ = |
| 1529 | match sexp_of_list sexp_of_int b__307_ with |
| 1530 | | Sexplib0.Sexp.List [] -> bnds__304_ |
| 1531 | | arg__308_ -> |
| 1532 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "b"; arg__308_ ] :: bnds__304_ |
| 1533 | : _ Stdlib.List.t) |
| 1534 | in |
| 1535 | let bnds__304_ = |
| 1536 | match sexp_of_option sexp_of_int a__305_ with |
| 1537 | | Sexplib0.Sexp.List [] -> bnds__304_ |
| 1538 | | arg__306_ -> |
| 1539 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__306_ ] :: bnds__304_ |
| 1540 | : _ Stdlib.List.t) |
| 1541 | in |
| 1542 | Sexplib0.Sexp.List bnds__304_ |
| 1543 | : t -> Sexplib0.Sexp.t) |
| 1544 | ;; |
| 1545 | |
| 1546 | let _ = sexp_of_t |
| 1547 | |
| 1548 | [@@@end] |
| 1549 | end |
| 1550 | |
| 1551 | module Variant_with_sexp_list = struct |
| 1552 | type t = A of int list [@sexp.list] [@@deriving_inline sexp] |
| 1553 | |
| 1554 | let _ = fun (_ : t) -> () |
| 1555 | |
| 1556 | let t_of_sexp = |
| 1557 | (let error_source__315_ = "expansion.ml.Variant_with_sexp_list.t" in |
| 1558 | function |
| 1559 | | Sexplib0.Sexp.List |
| 1560 | (Sexplib0.Sexp.Atom (("a" | "A") as _tag__318_) :: sexp_args__319_) as |
| 1561 | _sexp__317_ -> A (Sexplib0.Sexp_conv.list_map int_of_sexp sexp_args__319_) |
| 1562 | | Sexplib0.Sexp.Atom ("a" | "A") as sexp__316_ -> |
| 1563 | Sexplib0.Sexp_conv_error.stag_takes_args error_source__315_ sexp__316_ |
| 1564 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__314_ -> |
| 1565 | Sexplib0.Sexp_conv_error.nested_list_invalid_sum error_source__315_ sexp__314_ |
| 1566 | | Sexplib0.Sexp.List [] as sexp__314_ -> |
| 1567 | Sexplib0.Sexp_conv_error.empty_list_invalid_sum error_source__315_ sexp__314_ |
| 1568 | | sexp__314_ -> |
| 1569 | Sexplib0.Sexp_conv_error.unexpected_stag error_source__315_ sexp__314_ |
| 1570 | : Sexplib0.Sexp.t -> t) |
| 1571 | ;; |
| 1572 | |
| 1573 | let _ = t_of_sexp |
| 1574 | |
| 1575 | let sexp_of_t = |
| 1576 | (fun (A l__320_) -> |
| 1577 | Sexplib0.Sexp.List |
| 1578 | (Sexplib0.Sexp.Atom "A" :: Sexplib0.Sexp_conv.list_map sexp_of_int l__320_) |
| 1579 | : t -> Sexplib0.Sexp.t) |
| 1580 | ;; |
| 1581 | |
| 1582 | let _ = sexp_of_t |
| 1583 | |
| 1584 | [@@@end] |
| 1585 | end |
| 1586 | |
| 1587 | module Poly_variant_with_sexp_list = struct |
| 1588 | type t = [ `A of int list [@sexp.list] ] [@@deriving_inline sexp] |
| 1589 | |
| 1590 | let _ = fun (_ : t) -> () |
| 1591 | |
| 1592 | let __t_of_sexp__ = |
| 1593 | (let error_source__327_ = "expansion.ml.Poly_variant_with_sexp_list.t" in |
| 1594 | function |
| 1595 | | Sexplib0.Sexp.Atom atom__322_ as _sexp__324_ -> |
| 1596 | (match atom__322_ with |
| 1597 | | "A" -> Sexplib0.Sexp_conv_error.ptag_takes_args error_source__327_ _sexp__324_ |
| 1598 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 1599 | | Sexplib0.Sexp.List (Sexplib0.Sexp.Atom atom__322_ :: sexp_args__325_) as |
| 1600 | _sexp__324_ -> |
| 1601 | (match atom__322_ with |
| 1602 | | "A" as _tag__326_ -> |
| 1603 | `A (Sexplib0.Sexp_conv.list_map int_of_sexp sexp_args__325_) |
| 1604 | | _ -> Sexplib0.Sexp_conv_error.no_variant_match ()) |
| 1605 | | Sexplib0.Sexp.List (Sexplib0.Sexp.List _ :: _) as sexp__323_ -> |
| 1606 | Sexplib0.Sexp_conv_error.nested_list_invalid_poly_var error_source__327_ sexp__323_ |
| 1607 | | Sexplib0.Sexp.List [] as sexp__323_ -> |
| 1608 | Sexplib0.Sexp_conv_error.empty_list_invalid_poly_var error_source__327_ sexp__323_ |
| 1609 | : Sexplib0.Sexp.t -> t) |
| 1610 | ;; |
| 1611 | |
| 1612 | let _ = __t_of_sexp__ |
| 1613 | |
| 1614 | let t_of_sexp = |
| 1615 | (let error_source__329_ = "expansion.ml.Poly_variant_with_sexp_list.t" in |
| 1616 | fun sexp__328_ -> |
| 1617 | try __t_of_sexp__ sexp__328_ with |
| 1618 | | Sexplib0.Sexp_conv_error.No_variant_match -> |
| 1619 | Sexplib0.Sexp_conv_error.no_matching_variant_found error_source__329_ sexp__328_ |
| 1620 | : Sexplib0.Sexp.t -> t) |
| 1621 | ;; |
| 1622 | |
| 1623 | let _ = t_of_sexp |
| 1624 | |
| 1625 | let sexp_of_t = |
| 1626 | (fun (`A l__330_) -> |
| 1627 | Sexplib0.Sexp.List |
| 1628 | (Sexplib0.Sexp.Atom "A" :: Sexplib0.Sexp_conv.list_map sexp_of_int l__330_) |
| 1629 | : t -> Sexplib0.Sexp.t) |
| 1630 | ;; |
| 1631 | |
| 1632 | let _ = sexp_of_t |
| 1633 | |
| 1634 | [@@@end] |
| 1635 | end |
| 1636 | |
| 1637 | module Record_allowing_extra_fields = struct |
| 1638 | type t = { a : int } [@@allow_extra_fields] [@@deriving_inline sexp] |
| 1639 | |
| 1640 | let _ = fun (_ : t) -> () |
| 1641 | |
| 1642 | let t_of_sexp = |
| 1643 | (let error_source__332_ = "expansion.ml.Record_allowing_extra_fields.t" in |
| 1644 | fun x__333_ -> |
| 1645 | Sexplib0.Sexp_conv_record.record_of_sexp |
| 1646 | ~caller:error_source__332_ |
| 1647 | ~fields:(Field { name = "a"; kind = Required; conv = int_of_sexp; rest = Empty }) |
| 1648 | ~index_of_field:(function |
| 1649 | | "a" -> 0 |
| 1650 | | _ -> -1) |
| 1651 | ~allow_extra_fields:true |
| 1652 | ~create:(fun (a, ()) : t -> { a }) |
| 1653 | x__333_ |
| 1654 | : Sexplib0.Sexp.t -> t) |
| 1655 | ;; |
| 1656 | |
| 1657 | let _ = t_of_sexp |
| 1658 | |
| 1659 | let sexp_of_t = |
| 1660 | (fun { a = a__335_ } -> |
| 1661 | let bnds__334_ = ([] : _ Stdlib.List.t) in |
| 1662 | let bnds__334_ = |
| 1663 | let arg__336_ = sexp_of_int a__335_ in |
| 1664 | (Sexplib0.Sexp.List [ Sexplib0.Sexp.Atom "a"; arg__336_ ] :: bnds__334_ |
| 1665 | : _ Stdlib.List.t) |
| 1666 | in |
| 1667 | Sexplib0.Sexp.List bnds__334_ |
| 1668 | : t -> Sexplib0.Sexp.t) |
| 1669 | ;; |
| 1670 | |
| 1671 | let _ = sexp_of_t |
| 1672 | |
| 1673 | [@@@end] |
| 1674 | end |
| 1675 | |
| 1676 | module Opaque = struct |
| 1677 | type t = (int[@sexp.opaque]) list [@@deriving_inline sexp] |
| 1678 | |
| 1679 | let _ = fun (_ : t) -> () |
| 1680 | |
| 1681 | let t_of_sexp = |
| 1682 | (fun x__338_ -> list_of_sexp Sexplib0.Sexp_conv.opaque_of_sexp x__338_ |
| 1683 | : Sexplib0.Sexp.t -> t) |
| 1684 | ;; |
| 1685 | |
| 1686 | let _ = t_of_sexp |
| 1687 | |
| 1688 | let sexp_of_t = |
| 1689 | (fun x__339_ -> sexp_of_list Sexplib0.Sexp_conv.sexp_of_opaque x__339_ |
| 1690 | : t -> Sexplib0.Sexp.t) |
| 1691 | ;; |
| 1692 | |
| 1693 | let _ = sexp_of_t |
| 1694 | |
| 1695 | [@@@end] |
| 1696 | end |