mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
small details
This commit is contained in:
parent
c3590de261
commit
eace3581f1
2 changed files with 5 additions and 2 deletions
|
|
@ -407,7 +407,10 @@ let group_succ_by ?(eq=fun x y -> x = y) seq k =
|
|||
k l; (* yield group, and start another one *)
|
||||
cur := [x]);
|
||||
(* last list *)
|
||||
if !cur <> [] then k !cur
|
||||
begin match !cur with
|
||||
| [] -> ()
|
||||
| (_::_) as l -> k l
|
||||
end
|
||||
|
||||
(*$R
|
||||
[1;2;3;3;2;2;3;4]
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ val sorted : ?cmp:('a -> 'a -> int) -> 'a t -> bool
|
|||
@since 0.9 *)
|
||||
|
||||
val group_succ_by : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t
|
||||
(** Group equal consecutive elements.
|
||||
(** Group equal consecutive elements. Linear time.
|
||||
Formerly synonym to [group].
|
||||
@since 0.6 *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue