File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,8 @@ let rec equal f l1 l2 =
404
404
| [] , _ | _ , [] -> false
405
405
| x1 :: l1' , x2 :: l2' -> f x1 x2 && equal f l1' l2'
406
406
407
+ [@@@ iflt 5.1 ]
408
+
407
409
let rec flat_map_kont f l kont =
408
410
match l with
409
411
| [] -> kont []
@@ -415,8 +417,6 @@ let rec flat_map_kont f l kont =
415
417
let kont' tail = kont (append x tail) in
416
418
flat_map_kont f l' kont'
417
419
418
- [@@@ iflt 4.14 ]
419
-
420
420
let [@ inline] flat_map f l =
421
421
match l with
422
422
| [] -> []
Original file line number Diff line number Diff line change @@ -216,8 +216,12 @@ t @@ fun () ->
216
216
flat_map (fun x -> [ x + 1 ; x * 2 ]) [ 10 ; 100 ] = [ 11 ; 20 ; 101 ; 200 ]
217
217
;;
218
218
219
+
219
220
t @@ fun () -> List. length (flat_map (fun x -> [ x ]) (1 -- 300_000 )) = 300_000
220
221
;;
222
+ t @@ fun () ->
223
+ List. length (flat_map (fun _ -> 1 -- 300_000 ) (1 -- 2 )) = 600_000
224
+ ;;
221
225
222
226
eq [ 1 ; 2 ; 2 ; 3 ; 3 ; 3 ]
223
227
(flat_map_i (fun i x -> replicate (i + 1 ) x) [ 1 ; 2 ; 3 ])
You can’t perform that action at this time.
0 commit comments