package yocaml

  1. Overview
  2. Docs

Module Yocaml.BatchSource

Allows you to run batches of actions (on lists, directories, etc.)

Sourceval iter : 'a list -> ('a -> Action.t) -> Action.t

iter list action cache Executes the given action on all element of the given list. The cache is passed from call to call. see: Action.batch_list

Sourceval fold : state:'a -> 'b list -> ('b -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) -> Cache.t -> (Cache.t * 'a) Eff.t

fold ~state list action cache Executes the given action on all element of the given list. The cache is passed from call to call and instead of iter, you can maintain your own additional state. see: Action.fold_list

Sourceval iter_children : ?only:[ `Both | `Directories | `Files ] -> ?where:(Path.t -> bool) -> Path.t -> (Path.t -> Action.t) -> Action.t

iter_children ?only ?where path action cache Executes the given action on all child files of the given path. The cache is passed from call to call. see: Action.batch

Sourceval fold_children : ?only:[ `Both | `Directories | `Files ] -> ?where:(Path.t -> bool) -> state:'a -> Path.t -> (Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) -> Cache.t -> (Cache.t * 'a) Eff.t

fold_children ?only ?where ~state path action cache Executes the given action on all child files of the given path. The cache is passed from call to call and instead of iter_children, you can maintain your own additional state. see: Action.fold

Sourceval iter_files : ?where:(Path.t -> bool) -> Path.t -> (Path.t -> Action.t) -> Action.t

iter_files is iter_children ~only:`Files.

Sourceval fold_files : ?where:(Path.t -> bool) -> state:'a -> Path.t -> (Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) -> Cache.t -> (Cache.t * 'a) Eff.t

fold_files is fold_children ~only:`Files.

Sourceval iter_directories : ?where:(Path.t -> bool) -> Path.t -> (Path.t -> Action.t) -> Action.t

iter_directories is iter_children ~only:`Directories.

Sourceval fold_directories : ?where:(Path.t -> bool) -> state:'a -> Path.t -> (Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) -> Cache.t -> (Cache.t * 'a) Eff.t

fold_directories is fold_children ~only:`Directories.