small changes to CCList

This commit is contained in:
Simon Cruanes 2017-06-29 23:36:54 +02:00
parent 887d2f5d8d
commit 296cdc8748

View file

@ -400,15 +400,13 @@ let split l =
(x3, y3) :: (x3, y3) ::
(x4, y4) :: (x4, y4) ::
(x5, y5) :: l' -> (x5, y5) :: l' ->
let rx, ry = direct (i-1) l' let rx, ry = direct (i-1) l' in
in x1 :: x2 :: x3 :: x4 :: x5 :: rx,
(x1 :: x2 :: x3 :: x4 :: x5 :: rx, y1 :: y2 :: y3 :: y4 :: y5 :: ry
y1 :: y2 :: y3 :: y4 :: y5 :: ry)
and split_slow acc l = match l with and split_slow acc l = match l with
| [] -> acc | [] -> acc
| (x1, y1) :: l' -> | (x1, y1) :: l' ->
let acc = (x1 :: fst acc, y1 :: snd acc) let acc = x1 :: fst acc, y1 :: snd acc in
in
split_slow acc l' split_slow acc l'
in in
direct direct_depth_default_ l direct direct_depth_default_ l
@ -427,6 +425,9 @@ let split l =
let l2_y = List.nth l2 i in \ let l2_y = List.nth l2 i in \
let (x,y) = List.nth l i in \ let (x,y) = List.nth l i in \
l1_x = x && l2_y = y) l1_x = x && l2_y = y)
Q.(list (pair int int)) (fun l -> \
split l = List.split l)
*) *)
let return x = [x] let return x = [x]