From 66d4ae9811256de4bb9a6ba39b6fc4a94bbff8df Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 7 Nov 2017 13:56:38 +0100 Subject: [PATCH] missing function in `CCListLabels` --- src/core/CCListLabels.mli | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core/CCListLabels.mli b/src/core/CCListLabels.mli index 09125956..535eab06 100644 --- a/src/core/CCListLabels.mli +++ b/src/core/CCListLabels.mli @@ -97,6 +97,20 @@ val partition_map : f:('a -> [<`Left of 'b | `Right of 'c | `Drop]) -> - if [f x = `Drop], ignores [x] @since 0.11 *) +val sublists_of_len : + ?last:('a list -> 'a list option) -> + ?offset:int -> + len:int -> + 'a list -> + 'a list list +(** [sublists_of_len n l] returns sub-lists of [l] that have length [n]. + By default, these sub-lists are non overlapping: + [sublists_of_len 2 [1;2;3;4;5;6]] returns [[1;2]; [3;4]; [5;6]]. + + See {!CCList.sublists_of_len} for more details. + + @since NEXT_RELEASE *) + val pure : 'a -> 'a t val (<*>) : ('a -> 'b) t -> 'a t -> 'b t