From 296cdc8748d0baeca34bf322bf67089dd9c4a8b2 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 29 Jun 2017 23:36:54 +0200 Subject: [PATCH] small changes to CCList --- src/core/CCList.ml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/CCList.ml b/src/core/CCList.ml index c0d24c98..afad88ca 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -400,15 +400,13 @@ let split l = (x3, y3) :: (x4, y4) :: (x5, y5) :: l' -> - let rx, ry = direct (i-1) l' - in - (x1 :: x2 :: x3 :: x4 :: x5 :: rx, - y1 :: y2 :: y3 :: y4 :: y5 :: ry) + let rx, ry = direct (i-1) l' in + x1 :: x2 :: x3 :: x4 :: x5 :: rx, + y1 :: y2 :: y3 :: y4 :: y5 :: ry and split_slow acc l = match l with | [] -> acc | (x1, y1) :: l' -> - let acc = (x1 :: fst acc, y1 :: snd acc) - in + let acc = x1 :: fst acc, y1 :: snd acc in split_slow acc l' in direct direct_depth_default_ l @@ -427,6 +425,9 @@ let split l = let l2_y = List.nth l2 i in \ let (x,y) = List.nth l i in \ l1_x = x && l2_y = y) + + Q.(list (pair int int)) (fun l -> \ + split l = List.split l) *) let return x = [x]