To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
-
travesty
-
-
travesty_containers
-
-
travesty_core_kernel_exts
Library
Module
Module type
Parameter
Class
Class type
On_error
is On_monad
specialised to the error monad.
val pop_m :
'a t ->
on_empty:('a t -> ('a * 'a t) Base.Or_error.t) ->
('a * 'a t) Base.Or_error.t
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.Or_error.t) ->
'a Base.Or_error.t
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.
val step_m :
?steps:Base.int ->
'a t ->
on_empty:('a t -> 'a t Base.Or_error.t) ->
'a t Base.Or_error.t
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.
val map_m_head :
'a t ->
f:('a -> 'a Base.option Base.Or_error.t) ->
on_empty:('a t -> 'a t Base.Or_error.t) ->
'a t Base.Or_error.t
map_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 ->
on_empty:('a t -> 'a t Base.Or_error.t) ->
'a t Base.Or_error.t
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.
val recall_m :
'a t ->
mark:mark ->
on_empty:('a t -> 'a t Base.Or_error.t) ->
'a t Base.Or_error.t
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.
val delete_to_mark_m :
'a t ->
mark:mark ->
on_empty:('a t -> 'a t Base.Or_error.t) ->
'a t Base.Or_error.t
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 Base.Or_error.t) ->
init:'acc ->
finish:('acc -> 'a t -> 'final Base.Or_error.t) ->
'final Base.Or_error.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.