package travesty
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9c7b3803620c54496a35983285242ec8e06a5efb1baa3523384d7184b7e9fab7
sha512=991646fe5bb899971d3f8c00432d4df6c45dbd81cbff885b28d30d9c228e5df61f1e8d61aadc164ec35c448093abb34fd7a7d571e1cdf4d3af25579bf400f167
doc/travesty.containers/Travesty_containers/Zipper/Int_mark_zipper/On_monad/index.html
Module Int_mark_zipper.On_monad
On_monad
provides various marked zipper operations parametrised by a monad.
Parameters
module M : Base.Monad.S
Signature
include Zipper_types.S_monadic with type 'a t := 'a t with module M := M
pop_m zipper ~on_empty
behaves like pop, but executes a custom monadic action on_empty
, instead of returning an error, when the cursor is empty.
peek_m ?steps zipper ~on_empty
behaves like peek_opt, but executes a custom monadic action on_empty
, instead of returning None
, when the cursor is empty.
step_m ?steps zipper ~on_empty
behaves like step, but executes a custom monadic action on_empty
, instead of returning an error, when the cursor is empty.
mark_m zipper ~mark ~on_empty
behaves like mark, but executes a custom monadic action on_empty
, instead of returning an error, when the cursor is empty.
recall_m zipper ~mark ~on_empty
behaves like recall, but executes a custom monadic action on_empty
, instead of returning an error, when the mark can't be found.
delete_to_mark_m zipper ~mark ~on_empty
behaves like delete_to_mark, but executes a custom monadic action on_empty
, instead of returning an error, when the mark can't be found.
val fold_m_until :
'a t ->
f:
('acc ->
'a ->
'a t ->
(Base.int, 'a, 'acc, 'final) Zipper_types.fold_outcome M.t) ->
init:'acc ->
finish:('acc -> 'a t -> 'final M.t) ->
'final M.t
fold_m_until zipper ~f ~init ~finish
behaves like fold_until, except that f
and finish
, and therefore the function itself, return results inside a monad context.