aboutsummaryrefslogtreecommitdiff
path: root/lib/util.ml
diff options
context:
space:
mode:
authorherbelin2010-07-29 22:59:55 +0000
committerherbelin2010-07-29 22:59:55 +0000
commit3dbc498b78a1b64a5d0edc4e1ec947a0bbc2cae0 (patch)
tree8e76c87820bc45524e8f7ac40643ff7e7feb3118 /lib/util.ml
parent0824e2aaec90deea52d0a638e2a8a2da74f8fbb4 (diff)
Fixed a bug introduced (r13316/r13329) in the printing of notations
with non-recursive binders. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13357 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 16e00a0899..7e62f77032 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -699,6 +699,16 @@ let list_split_when p =
in
split_when_loop []
+(* [list_split_by p l] splits [l] into two lists [(l1,l2)] such that elements of
+ [l1] satisfy [p] and elements of [l2] do not *)
+let list_split_by p =
+ let rec split_by_loop = function
+ | [] -> ([],[])
+ | a::l ->
+ let (l1,l2) = split_by_loop l in if p a then (a::l1,l2) else (l1,a::l2)
+ in
+ split_by_loop
+
let rec list_split3 = function
| [] -> ([], [], [])
| (x,y,z)::l ->