summaryrefslogtreecommitdiff
path: root/lib/ur/list.urs
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-05-30 17:33:12 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-05-30 17:33:12 -0400
commita3e471e933945dcfb54873cb20c691a193b55671 (patch)
tree70ba7ffe26a589f0b97aec7016c171261c54c9e2 /lib/ur/list.urs
parent5ca6148aaf7b930a8868d0543f1a307d40532243 (diff)
parent359c1ca68f97181dada92e28440c7336fc88fff5 (diff)
Merge branch 'upstream' into dfsg_clean20160515+dfsg
Diffstat (limited to 'lib/ur/list.urs')
-rw-r--r--lib/ur/list.urs6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ur/list.urs b/lib/ur/list.urs
index 55068935..432d8c1a 100644
--- a/lib/ur/list.urs
+++ b/lib/ur/list.urs
@@ -105,3 +105,9 @@ val recToList : a ::: Type -> r ::: {Unit} -> folder r -> $(mapU a r) -> t a
val drop : t ::: Type -> int -> list t -> list t
val take : t ::: Type -> int -> list t -> list t
val splitAt : t ::: Type -> int -> list t -> list t * list t
+
+(** Longest prefix of elements that satisfy a predicate, returned along with the remaining suffix *)
+val span : a ::: Type -> (a -> bool) -> t a -> t a * t a
+
+(** Group a list into maximal adjacent segments where all elements compare as equal, according to the provided predicate. *)
+val groupBy : a ::: Type -> (a -> a -> bool) -> t a -> t (t a)