|
3 | 3 | module JsArray(E:Ojs.T) = |
4 | 4 | struct |
5 | 5 | type t = Ojs.t |
6 | | - let rec (t_of_js : Ojs.t -> t) = fun (x2 : Ojs.t) -> x2 |
7 | | - and (t_to_js : t -> Ojs.t) = fun (x1 : Ojs.t) -> x1 |
8 | | - let (create : unit -> t) = |
| 6 | + let rec t_of_js : Ojs.t -> t = fun (x2 : Ojs.t) -> x2 |
| 7 | + and t_to_js : t -> Ojs.t = fun (x1 : Ojs.t) -> x1 |
| 8 | + let create : unit -> t = |
9 | 9 | fun () -> |
10 | 10 | t_of_js (Ojs.new_obj (Ojs.get_prop_ascii Ojs.global "Array") [||]) |
11 | | - let (push : t -> E.t -> unit) = |
12 | | - fun (x4 : t) -> |
13 | | - fun (x3 : E.t) -> |
14 | | - ignore (Ojs.call (t_to_js x4) "push" [|(E.t_to_js x3)|]) |
15 | | - let (pop : t -> E.t option) = |
| 11 | + let push : t -> E.t -> unit = |
| 12 | + fun (x4 : t) (x3 : E.t) -> |
| 13 | + ignore (Ojs.call (t_to_js x4) "push" [|(E.t_to_js x3)|]) |
| 14 | + let pop : t -> E.t option = |
16 | 15 | fun (x5 : t) -> |
17 | 16 | Ojs.option_of_js E.t_of_js (Ojs.call (t_to_js x5) "pop" [||]) |
18 | 17 | end |
19 | 18 | module UntypedArray = struct include (JsArray)(Ojs) end |
20 | 19 | module StringArray = |
21 | 20 | struct |
22 | 21 | include (JsArray)(Ojs.String) |
23 | | - let (join : t -> string -> string) = |
24 | | - fun (x8 : t) -> |
25 | | - fun (x7 : string) -> |
26 | | - Ojs.string_of_js |
27 | | - (Ojs.call (t_to_js x8) "join" [|(Ojs.string_to_js x7)|]) |
| 22 | + let join : t -> string -> string = |
| 23 | + fun (x8 : t) (x7 : string) -> |
| 24 | + Ojs.string_of_js |
| 25 | + (Ojs.call (t_to_js x8) "join" [|(Ojs.string_to_js x7)|]) |
28 | 26 | end |
29 | 27 | module JsArray2 = |
30 | 28 | struct |
31 | 29 | type 'a t = Ojs.t |
32 | 30 | let rec t_of_js : 'a . (Ojs.t -> 'a) -> Ojs.t -> 'a t = |
33 | | - fun (type __a) -> |
34 | | - fun (__a_of_js : Ojs.t -> __a) -> fun (x10 : Ojs.t) -> x10 |
| 31 | + fun (type __a) (__a_of_js : Ojs.t -> __a) -> fun (x10 : Ojs.t) -> x10 |
35 | 32 | and t_to_js : 'a . ('a -> Ojs.t) -> 'a t -> Ojs.t = |
36 | | - fun (type __a) -> |
37 | | - fun (__a_to_js : __a -> Ojs.t) -> fun (x9 : Ojs.t) -> x9 |
38 | | - let (create : unit -> 'a t) = |
| 33 | + fun (type __a) (__a_to_js : __a -> Ojs.t) -> fun (x9 : Ojs.t) -> x9 |
| 34 | + let create : unit -> 'a t = |
39 | 35 | fun () -> |
40 | 36 | t_of_js Obj.magic |
41 | 37 | (Ojs.new_obj (Ojs.get_prop_ascii Ojs.global "Array") [||]) |
42 | | - let (create' : (module Ojs.T with type t = 'a) -> 'a list -> 'a t) = |
| 38 | + let create' : (module Ojs.T with type t = 'a) -> 'a list -> 'a t = |
43 | 39 | fun (type a) -> |
44 | | - fun ((module A) : (module Ojs.T with type t = a)) -> |
45 | | - fun (x12 : a list) -> |
46 | | - t_of_js A.t_of_js |
47 | | - (Ojs.new_obj_arr (Ojs.get_prop_ascii Ojs.global "Array") |
48 | | - (let x13 = |
49 | | - Ojs.new_obj (Ojs.get_prop_ascii Ojs.global "Array") [||] in |
50 | | - List.iter |
51 | | - (fun (x14 : a) -> |
52 | | - ignore (Ojs.call x13 "push" [|(A.t_to_js x14)|])) x12; |
53 | | - x13)) |
54 | | - let (push : (module Ojs.T with type t = 'a) -> 'a t -> 'a -> unit) = |
| 40 | + fun ((module A) : (module Ojs.T with type t = a)) (x12 : a list) -> |
| 41 | + t_of_js A.t_of_js |
| 42 | + (Ojs.new_obj_arr (Ojs.get_prop_ascii Ojs.global "Array") |
| 43 | + (let x13 = |
| 44 | + Ojs.new_obj (Ojs.get_prop_ascii Ojs.global "Array") [||] in |
| 45 | + List.iter |
| 46 | + (fun (x14 : a) -> |
| 47 | + ignore (Ojs.call x13 "push" [|(A.t_to_js x14)|])) x12; |
| 48 | + x13)) |
| 49 | + let push : (module Ojs.T with type t = 'a) -> 'a t -> 'a -> unit = |
55 | 50 | fun (type a) -> |
56 | | - fun ((module A) : (module Ojs.T with type t = a)) -> |
57 | | - fun (x17 : a t) -> |
58 | | - fun (x16 : a) -> |
59 | | - ignore |
60 | | - (Ojs.call (t_to_js A.t_to_js x17) "push" [|(A.t_to_js x16)|]) |
61 | | - let (pop : (module Ojs.T with type t = 'a) -> 'a t -> 'a option) = |
| 51 | + fun ((module A) : (module Ojs.T with type t = a)) (x17 : a t) |
| 52 | + (x16 : a) -> |
| 53 | + ignore |
| 54 | + (Ojs.call (t_to_js A.t_to_js x17) "push" [|(A.t_to_js x16)|]) |
| 55 | + let pop : (module Ojs.T with type t = 'a) -> 'a t -> 'a option = |
62 | 56 | fun (type a) -> |
63 | | - fun ((module A) : (module Ojs.T with type t = a)) -> |
64 | | - fun (x19 : a t) -> |
65 | | - Ojs.option_of_js A.t_of_js |
66 | | - (Ojs.call (t_to_js A.t_to_js x19) "pop" [||]) |
67 | | - let (get : (module Ojs.T with type t = 'a) -> 'a t -> int -> 'a option) = |
| 57 | + fun ((module A) : (module Ojs.T with type t = a)) (x19 : a t) -> |
| 58 | + Ojs.option_of_js A.t_of_js |
| 59 | + (Ojs.call (t_to_js A.t_to_js x19) "pop" [||]) |
| 60 | + let get : (module Ojs.T with type t = 'a) -> 'a t -> int -> 'a option = |
68 | 61 | fun (type a) -> |
69 | | - fun ((module A) : (module Ojs.T with type t = a)) -> |
70 | | - fun (x22 : a t) -> |
71 | | - fun (x24 : int) -> |
72 | | - Ojs.option_of_js A.t_of_js |
73 | | - (Ojs.array_get (t_to_js A.t_to_js x22) x24) |
74 | | - let (set : (module Ojs.T with type t = 'a) -> 'a t -> int -> 'a -> unit) |
75 | | - = |
| 62 | + fun ((module A) : (module Ojs.T with type t = a)) (x22 : a t) |
| 63 | + (x24 : int) -> |
| 64 | + Ojs.option_of_js A.t_of_js |
| 65 | + (Ojs.array_get (t_to_js A.t_to_js x22) x24) |
| 66 | + let set : (module Ojs.T with type t = 'a) -> 'a t -> int -> 'a -> unit = |
76 | 67 | fun (type a) -> |
77 | | - fun ((module A) : (module Ojs.T with type t = a)) -> |
78 | | - fun (x26 : a t) -> |
79 | | - fun (x28 : int) -> |
80 | | - fun (x29 : a) -> |
81 | | - Ojs.array_set (t_to_js A.t_to_js x26) x28 (A.t_to_js x29) |
82 | | - let (join : string t -> string -> string) = |
83 | | - fun (x31 : string t) -> |
84 | | - fun (x30 : string) -> |
85 | | - Ojs.string_of_js |
86 | | - (Ojs.call (t_to_js Ojs.string_to_js x31) "join" |
87 | | - [|(Ojs.string_to_js x30)|]) |
| 68 | + fun ((module A) : (module Ojs.T with type t = a)) (x26 : a t) |
| 69 | + (x28 : int) (x29 : a) -> |
| 70 | + Ojs.array_set (t_to_js A.t_to_js x26) x28 (A.t_to_js x29) |
| 71 | + let join : string t -> string -> string = |
| 72 | + fun (x31 : string t) (x30 : string) -> |
| 73 | + Ojs.string_of_js |
| 74 | + (Ojs.call (t_to_js Ojs.string_to_js x31) "join" |
| 75 | + [|(Ojs.string_to_js x30)|]) |
88 | 76 | end |
0 commit comments