package batteries

  1. Overview
  2. Docs
A community-maintained standard library extension

Install

Dune Dependency

Authors

Maintainers

Sources

v3.9.0.tar.gz
md5=ea26b5c72e6731e59d856626049cca4d
sha512=55975b62c26f6db77433a3ac31f97af609fc6789bb62ac38b267249c78fd44ff37fe81901f1cf560857b9493a6046dd37b0d1c0234c66bd59e52843aac3ce6cb

doc/batteries.unthreaded/BatEnum/Infix/index.html

Module BatEnum.InfixSource

Sourceval (--) : int -> int -> int t

As range, without the label.

5 -- 10 is the enumeration 5,6,7,8,9,10. 10 -- 5 is the empty enumeration

Sourceval (--^) : int -> int -> int t

As (--) but without the right endpoint

5 --^ 10 is the enumeration 5,6,7,8,9.

Sourceval (--.) : (float * float) -> float -> float t

(a, step) --. b) creates a float enumeration from a to b with an increment of step between elements.

(5.0, 1.0) --. 10.0 is the enumeration 5.0,6.0,7.0,8.0,9.0,10.0. (10.0, -1.0) --. 5.0 is the enumeration 10.0,9.0,8.0,7.0,6.0,5.0. (10.0, 1.0) --. 1.0 is the empty enumeration.

Sourceval (---) : int -> int -> int t

As --, but accepts enumerations in reverse order.

5 --- 10 is the enumeration 5,6,7,8,9,10. 10 --- 5 is the enumeration 10,9,8,7,6,5.

Sourceval (--~) : char -> char -> char t

As ( -- ), but for characters.

Sourceval (//) : 'a t -> ('a -> bool) -> 'a t

Filtering (pronounce this operator name "such that").

For instance, (1 -- 37) // odd is the enumeration of all odd numbers between 1 and 37.

Sourceval (/@) : 'a t -> ('a -> 'b) -> 'b t
Sourceval (@/) : ('a -> 'b) -> 'a t -> 'b t

Mapping operators.

These operators have the same meaning as function map but are sometimes more readable than this function, when chaining several transformations in a row.

Sourceval (//@) : 'a t -> ('a -> 'b option) -> 'b t
Sourceval (@//) : ('a -> 'b option) -> 'a t -> 'b t

Map combined with filter. Same as filter_map.

OCaml

Innovation. Community. Security.