package travesty

  1. Overview
  2. Docs
Traversable containers, monad extensions, and more

Install

Dune Dependency

Authors

Maintainers

Sources

travesty-0.8.0.tbz
sha256=216c920c872cef2d52fa58e3c49826766a2cf6f2233e64937f18c46c0c5c5388
sha512=3b4f76794666aa3fb16c3639479790df3478a79e6f582b3e66b144e57df26a76580499961dd374f4fb6f3bd2dd7506e2725ed1242bada9deb14eb1916cacd18f

doc/travesty.containers/Travesty_containers/Zipper/Plain/On_error/index.html

Module Plain.On_errorSource

On_error is On_monad specialised to the error monad.

Sourceval 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.

Sourceval 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.

Sourceval 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.

Sourceval 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.

OCaml

Innovation. Community. Security.