-
travesty
-
-
travesty.containers
-
-
travesty.core_kernel_exts
Library
Module
Module type
Parameter
Class
Class type
S_marked_monadic
extends S_monadic
to add functions for manipulating marks.
include S_monadic
module M : Base.Monad.S
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 -> (mark, 'a, 'acc, 'final) 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.