Logo ProcessCore

List Module

Functions and values

Function or value Description

groupWhen f list

Full Usage: groupWhen f list

Parameters:
    f : 'a -> bool
    list : 'a list

Returns: 'a list list
Type parameters: 'a
 Iterates over elements of the input list and groups adjacent elements.
 A new group is started when the specified predicate holds about the element
 of the list (and at the beginning of the iteration).

 For example:
    List.groupWhen isOdd [3;3;2;4;1;2] = [[3]; [3; 2; 4]; [1; 2]]
f : 'a -> bool
list : 'a list
Returns: 'a list list

Type something to start searching.