@@ -169,14 +169,14 @@ let rec findFirstByU n p =
169
169
match n with
170
170
| None -> None
171
171
| Some n ->
172
- let left = n .left |. findFirstByU p in
172
+ let left = findFirstByU n.left p in
173
173
if left <> None then left
174
174
else
175
175
let {key = v; value = d} = n in
176
176
let pvd = p v d [@ bs] in
177
177
if pvd then Some (v, d)
178
178
else
179
- let right = n.right |. findFirstByU p in
179
+ let right = findFirstByU n.right p in
180
180
if right <> None then right else None
181
181
182
182
let findFirstBy n p = findFirstByU n (fun [@bs ] a b -> p a b)
@@ -185,9 +185,9 @@ let rec forEachU n f =
185
185
match n with
186
186
| None -> ()
187
187
| Some n ->
188
- n .left |. forEachU f ;
188
+ forEachU n.left f ;
189
189
f n.key n.value [@ bs];
190
- n.right|. forEachU f
190
+ forEachU n.right f
191
191
192
192
let forEach n f = forEachU n (fun [@bs ] a b -> f a b)
193
193
@@ -196,9 +196,9 @@ let rec mapU n f =
196
196
None ->
197
197
None
198
198
| Some n ->
199
- let newLeft = n .left |. mapU f in
199
+ let newLeft = mapU n.left f in
200
200
let newD = f n.value [@ bs] in
201
- let newRight = n.right|. mapU f in
201
+ let newRight = mapU n.right f in
202
202
Some { left = newLeft; key = n.key; value = newD; right = newRight; height = n.height}
203
203
204
204
let map n f = mapU n (fun[@ bs] a -> f a)
@@ -209,9 +209,9 @@ let rec mapWithKeyU n f =
209
209
None
210
210
| Some n ->
211
211
let key = n.key in
212
- let newLeft = n .left |. mapWithKeyU f in
212
+ let newLeft = mapWithKeyU n.left f in
213
213
let newD = f key n.value [@ bs] in
214
- let newRight = n.right |. mapWithKeyU f in
214
+ let newRight = mapWithKeyU n.right f in
215
215
Some { left = newLeft; key; value = newD; right = newRight; height = n.height}
216
216
217
217
let mapWithKey n f = mapWithKeyU n (fun [@bs ] a b -> f a b)
@@ -232,17 +232,17 @@ let rec everyU n p =
232
232
None -> true
233
233
| Some n ->
234
234
p n.key n.value [@ bs] &&
235
- n .left |. everyU p &&
236
- n.right|. everyU p
235
+ everyU n .left p &&
236
+ everyU n.right p
237
237
let every n p = everyU n (fun [@bs ] a b -> p a b)
238
238
239
239
let rec someU n p =
240
240
match n with
241
241
None -> false
242
242
| Some n ->
243
243
p n.key n.value [@ bs] ||
244
- n .left |. someU p ||
245
- n.right|. someU p
244
+ someU n .left p ||
245
+ someU n.right p
246
246
let some n p = someU n (fun[@ bs] a b -> p a b)
247
247
(* Beware: those two functions assume that the added k is *strictly*
248
248
smaller (or bigger) than all the present keys in the tree; it
@@ -304,9 +304,9 @@ let rec keepSharedU n p =
304
304
| Some n ->
305
305
(* call [p] in the expected left-to-right order *)
306
306
let {key = v; value = d} = n in
307
- let newLeft = n .left |. keepSharedU p in
307
+ let newLeft = keepSharedU n.left p in
308
308
let pvd = p v d [@ bs] in
309
- let newRight = n.right|. keepSharedU p in
309
+ let newRight = keepSharedU n.right p in
310
310
if pvd then join newLeft v d newRight else concat newLeft newRight
311
311
312
312
let keepShared n p = keepSharedU n (fun [@bs ] a b -> p a b)
@@ -317,9 +317,9 @@ let rec keepMapU n p =
317
317
| Some n ->
318
318
(* call [p] in the expected left-to-right order *)
319
319
let {key = v; value = d} = n in
320
- let newLeft = n .left |. keepMapU p in
320
+ let newLeft = keepMapU n .left p in
321
321
let pvd = p v d [@ bs] in
322
- let newRight = n.right|. keepMapU p in
322
+ let newRight = keepMapU n.right p in
323
323
match pvd with
324
324
| None -> concat newLeft newRight
325
325
| Some d -> join newLeft v d newRight
@@ -332,9 +332,9 @@ let rec partitionSharedU n p =
332
332
| Some n ->
333
333
let {key; value } = n in
334
334
(* call [p] in the expected left-to-right order *)
335
- let (lt, lf) = n .left |. partitionSharedU p in
335
+ let (lt, lf) = partitionSharedU n.left p in
336
336
let pvd = p key value [@ bs] in
337
- let (rt, rf) = n.right|. partitionSharedU p in
337
+ let (rt, rf) = partitionSharedU n.right p in
338
338
if pvd
339
339
then (join lt key value rt, concat lf rf)
340
340
else (concat lt rt, join lf key value rf)
@@ -365,7 +365,7 @@ let rec toListAux n accu =
365
365
| None -> accu
366
366
| Some n ->
367
367
let {left = l; right = r ; key = k; value = v} = n in
368
- l |. toListAux ((k, v) :: ( r |. toListAux accu ))
368
+ toListAux l ((k, v) :: (toListAux r accu ))
369
369
370
370
let toList s =
371
371
toListAux s []
0 commit comments