package batteries
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=1fd7bddce07cf5d244fc9427f7b5e4d4
sha512=c0f2a0fdc8253e0ea999d8d4c58bfbf32b18d251a2e1d9656bf279de5f01a33e9aabac3af4d95f465f8b671e7711ebd37218043face233340a0c11b08fa62f78
doc/batteries.unthreaded/BatLazyList/Exceptionless/index.html
Module BatLazyList.ExceptionlessSource
Exceptionless counterparts for error-raising operations
find p l returns Some x where x is the first element of l such that p x returns true or None if such element as not been found.
rfind p l returns Some x where x is the last element of l such that p x returns true or None if such element as not been found.
findi p e l returns Some (i, ai) where ai and i are respectively the first element of l and its index, such that p i ai is true, or None if no such element has been found.
rfindi p e l returns Some (i, ai) where ai and i are respectively the last element of l and its index, such that p i ai is true, or None if no such element has been found.
Whenever n is inside of l size bounds, split_at n l returns `Ok (l1,l2), where l1 contains the first n elements of l and l2 contains the others. Otherwise, returns `Invalid_index n
If n is inside the bounds of l, at l n returns `Ok x, where x is the n-th element of the list l. Otherwise, returns `Invalid_index n.
assoc a l returns Some b where b is the value associated with key a in the list of pairs l. That is, assoc a [ ...; (a,b); ...] = Some b if (a,b) is the leftmost binding of a in list l. Return None if there is no value associated with a in the list l.