package batteries
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=1fd7bddce07cf5d244fc9427f7b5e4d4
sha512=c0f2a0fdc8253e0ea999d8d4c58bfbf32b18d251a2e1d9656bf279de5f01a33e9aabac3af4d95f465f8b671e7711ebd37218043face233340a0c11b08fa62f78
doc/batteries.unthreaded/BatEnum/Infix/index.html
Module BatEnum.Infix
Source
As range
, without the label.
5 -- 10
is the enumeration 5,6,7,8,9,10. 10 -- 5
is the empty enumeration
As (--)
but without the right endpoint
5 --^ 10
is the enumeration 5,6,7,8,9.
(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.
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.
Filtering (pronounce this operator name "such that").
For instance, (1 -- 37) // odd
is the enumeration of all odd numbers between 1 and 37.
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.
Map combined with filter. Same as filter_map
.