Legend:
Library
Module
Module type
Parameter
Class
Class type
Extensions1 contains extensions for a Container.S1.
type'a t
The type of the container to extend.
val max_measure : measure:('a-> int)->?default:int ->'at-> int
max_measure ~measure ~default xs measures each item in xs according to measure, and returns the highest measure reported. If xs is empty, return default if given, and 0 otherwise.
Containers of predicates
The following functions concern containers of predicates (functions of type 'a -> bool).
any x ~predicates tests x against predicates until one returns true, in which case it returns true; or all return false, in which case it returns false.
any x ~predicates tests x against predicates until one returns false, in which case it returns false; or all return true, in which case it returns true.
none x ~predicates is the same as any x with all predicates in predicates negated. It tests x against predicates until one returns true, in which case it returns false; or all return false, in which case it returns true.
Testing for a specific number of elements
The following functions help in checking whether a container has a particular, commonly-required number of elements (zero or one, one, two, and so on).