package travesty
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=216c920c872cef2d52fa58e3c49826766a2cf6f2233e64937f18c46c0c5c5388
sha512=3b4f76794666aa3fb16c3639479790df3478a79e6f582b3e66b144e57df26a76580499961dd374f4fb6f3bd2dd7506e2725ed1242bada9deb14eb1916cacd18f
doc/travesty.containers/Travesty_containers/Zipper/Make_marked/On_option/index.html
Module Make_marked.On_optionSource
On_option is On_monad specialised to the option monad.
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.
val peek_m :
?steps:Base.int ->
'a t ->
on_empty:('a t -> 'a Base.Option.t) ->
'a Base.Option.tpeek_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.
val step_m :
?steps:Base.int ->
'a t ->
on_empty:('a t -> 'a t Base.Option.t) ->
'a t Base.Option.tstep_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.
val map_m_head :
'a t ->
f:('a -> 'a Base.option Base.Option.t) ->
on_empty:('a t -> 'a t Base.Option.t) ->
'a t Base.Option.tmap_m_head ?steps zipper ~on_empty behaves like map_head, but executes a custom monadic action on_empty, instead of leaving the zipper unchanged, when the cursor is empty.
val mark_m :
'a t ->
mark:Mark.t ->
on_empty:('a t -> 'a t Base.Option.t) ->
'a t Base.Option.tmark_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.
val recall_m :
'a t ->
mark:Mark.t ->
on_empty:('a t -> 'a t Base.Option.t) ->
'a t Base.Option.trecall_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.
val delete_to_mark_m :
'a t ->
mark:Mark.t ->
on_empty:('a t -> 'a t Base.Option.t) ->
'a t Base.Option.tdelete_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.t, 'a, 'acc, 'final) Zipper_types.fold_outcome Base.Option.t) ->
init:'acc ->
finish:('acc -> 'a t -> 'final Base.Option.t) ->
'final Base.Option.tfold_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.