TzPervasives.List
include module type of Tezos_stdlib.TzList
repeat n x
is List.of_array (Array.make n x)
but more efficient.
If n < 0
it is the empty list []
.
take_n n l
returns the n
first elements of l
.
If n < 0
it is the empty list []
. If n > List.length l
it is the list l
in its entirety.
rev_take_n n l
is List.rev (take_n n l)
but more efficient.
drop_n n l
returns the suffix of l
after the first n
elements.
If n < 0
it is the list l
in its entirety. If n > List.length l
it is the empty list []
.
split_n n l
is (take_n n l, drop_n n l)
but more efficient.
rev_split_n n l
is (rev_take_n n l, drop_n n l)
but more efficient.
include module type of Tezos_error_monad.TzLwtreslib.List
val init_ep :
when_negative_length:'error ->
int ->
(int -> ('a, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
('a list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val filter_ep :
('a -> (bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('a list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val filteri_ep :
(int ->
'a ->
(bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('a list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val partition_ep :
('a -> (bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('a list * 'a list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result
Lwt.t
val partition_map_ep :
('a ->
(('b, 'c) Stdlib.Either.t, 'error Tezos_error_monad.TzTrace.trace)
Stdlib.result
Lwt.t) ->
'a list ->
('b list * 'c list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result
Lwt.t
val iter_ep :
('a -> (unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
(unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val iteri_ep :
(int ->
'a ->
(unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
(unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val map_ep :
('a -> ('b, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val mapi_ep :
(int ->
'a ->
('b, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val rev_map_ep :
('a -> ('b, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val rev_mapi_ep :
(int ->
'a ->
('b, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val filter_map_ep :
('a ->
('b option, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val concat_map_ep :
('a -> ('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
('b list, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val for_all_ep :
('a -> (bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
(bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
val exists_ep :
('a -> (bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) ->
'a list ->
(bool, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t