Module Travesty.Container_extsSource

Extensions for containers.

We keep these in the main Travesty library because it's useful to pull them in for mappable and traversable containers.

As usual, we store the extension signatures in a separate intf module.

include module type of Container_exts_intf

Generic extensions

As is often the case in Travesty, we define an arity-generic signature first, then specialise it for arity-0 and arity-1 containers.

Sourcemodule type Generic = sig ... end

Containers of predicates

The following functions concern containers of predicates (functions of type 'a -> bool).

Sourcemodule type Generic_predicate = sig ... end

Arity-0 container extensions

These extensions target arity-0 containers (implementations of Container.S0).

Sourcemodule type S0 = sig ... end

Extensions for a Container.S0.

Sourcemodule type S0_predicate = sig ... end

Extensions for a Container.S0 whose elements are predicates.

Arity-1 container extensions

These extensions target arity-1 containers (implementations of Container.S1).

Sourcemodule type S1 = sig ... end

Extensions for a Container.S1.

Extension functors

These functors extend Core containers with the extensions described in S0 and S1.

Sourcemodule Extend0 (C : Base.Container.S0) : S0 with type t := C.t and type elt := C.elt

Extend0 creates extensions for a Container.S0.

Sourcemodule Extend0_predicate (P : Base.T) (C : Base.Container.S0 with type elt = P.t -> Base.bool) : S0_predicate with type t := C.t and type item := P.t

Extend0_predicate creates extensions for a Container.S0 over predicates.

Sourcemodule Extend1 (C : Base.Container.S1) : S1 with type 'a t := 'a C.t

Extend1 creates extensions for a Container.S1.