package travesty

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Extensions1 describes various extensions of arity-1 mappable containers.

type 'a t

t is the type of the container to map over.

Extensions1 includes the container extensions from T_container, as they work with any arity-1 container.

include T_container.Extensions1 with type 'a t := 'a t
val max_measure : measure:('a -> int) -> ?default:int -> 'a t -> 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.

val any : predicates:('a -> bool) t -> 'a -> bool

any ~predicates x tests x against predicates until one returns true, or all return false.

val right_pad : padding:'a -> 'a Base.list t -> 'a Base.list t

right_pad ~padding xs pads every list in xs with padding, ensuring all lists have equal length.

OCaml

Innovation. Community. Security.