Pure utility functions for inspecting, querying, traversing, transforming, reconstructing, and composing Effect pipelines and ASTs.
Pure utility functions for inspecting, querying, traversing, transforming, reconstructing, and composing Effect pipelines and ASTs.
(append-leaf target-chain new-leaf-effect)Appends new-leaf-effect to the end of target-chain.
Appends `new-leaf-effect` to the end of `target-chain`.
(around> before-eff-fn after-eff-fn)Creates a combinator that wraps any target effect stage with a before-eff-fn
and an after-eff-fn, while preserving the stage's computed value.
Creates a combinator that wraps any target effect stage with a `before-eff-fn` and an `after-eff-fn`, while preserving the stage's computed value.
(ast-seq effect)Returns a lazy sequence of all effects in the AST rooted at effect in depth-first order.
Returns a lazy sequence of all effects in the AST rooted at `effect` in depth-first order.
(chain-length leaf-effect)Returns the total number of effect nodes in the linear pipeline.
Returns the total number of effect nodes in the linear pipeline.
(comp> & combinators)Composes effect combinator functions (each of type Effect -> Effect)
in right-to-left (standard mathematical) order into a single composite combinator.
Composes effect combinator functions (each of type `Effect -> Effect`) in right-to-left (standard mathematical) order into a single composite combinator.
(compose-ast-passes & passes)Composes pipeline rewrite passes (Effect -> Effect) into an optimizing compiler pipeline.
Composes pipeline rewrite passes `(Effect -> Effect)` into an optimizing compiler pipeline.
(concat-chains & chains)Concatenates multiple effect chains into a single continuous pipeline.
Concatenates multiple effect chains into a single continuous pipeline.
(direct-sub-effects effect)Returns a vector of all direct child effects referenced by effect
(including upstream :prev-effect and nested branch/body effects in :data or record fields).
Returns a vector of all direct child effects referenced by `effect` (including upstream `:prev-effect` and nested branch/body effects in `:data` or record fields).
(effect-seq leaf-effect)Returns a vector of effects in forward execution order (root -> leaf).
Returns a vector of effects in forward execution order (root -> leaf).
(effect-seq-reverse leaf-effect)Returns a lazy sequence of effects starting from leaf-effect back to the root (leaf -> root),
following upstream :prev-effect links.
Returns a lazy sequence of effects starting from `leaf-effect` back to the root (leaf -> root), following upstream `:prev-effect` links.
(effect-tags leaf-effect)Returns a vector of tags representing the execution pipeline in forward order.
Returns a vector of tags representing the execution pipeline in forward order.
(find-all-by-tag leaf-effect target-tag)Returns a vector of all effects with the specified target-tag.
Returns a vector of all effects with the specified `target-tag`.
(find-all-effects leaf-effect pred)Returns a vector of all effects satisfying pred in forward execution order.
Returns a vector of all effects satisfying `pred` in forward execution order.
(find-first-by-tag leaf-effect target-tag)Finds the first effect matching the given target-tag in forward execution order.
Finds the first effect matching the given `target-tag` in forward execution order.
(find-first-effect leaf-effect pred)Returns the first effect in forward execution order satisfying pred, or nil.
Returns the first effect in forward execution order satisfying `pred`, or nil.
(insert-after-tag leaf-effect target-tag new-effect)Inserts new-effect immediately after the first node matching target-tag.
Inserts `new-effect` immediately after the first node matching `target-tag`.
(insert-before-tag leaf-effect target-tag new-effect)Inserts new-effect immediately before the first node matching target-tag.
Inserts `new-effect` immediately before the first node matching `target-tag`.
(insert-effect-after leaf-effect pred new-effect)Inserts new-effect immediately after the first node satisfying pred.
Inserts `new-effect` immediately after the first node satisfying `pred`.
(insert-effect-before leaf-effect pred new-effect)Inserts new-effect immediately before the first node satisfying pred.
Inserts `new-effect` immediately before the first node satisfying `pred`.
(map-effects leaf-effect f)Applies pure transform (f effect) to every node in the pipeline from root to leaf,
rebuilding the chain structure.
Applies pure transform `(f effect)` to every node in the pipeline from root to leaf, rebuilding the chain structure.
(pipe-fx-fn> & fx-fns)Composes effect-producing functions (Kleisli arrows: a -> Effect[b]) from left to right.
Returns a function (fn [initial-val] -> Effect[final-val]).
Composes effect-producing functions (Kleisli arrows: `a -> Effect[b]`) from left to right. Returns a function `(fn [initial-val] -> Effect[final-val])`.
(pipe> & combinators)Composes a series of effect combinator functions (each of type Effect -> Effect)
in left-to-right (forward) execution order into a single composite combinator.
Composes a series of effect combinator functions (each of type `Effect -> Effect`) in left-to-right (forward) execution order into a single composite combinator.
(prepend-root target-chain new-root-effect)Prepends new-root-effect at the start of target-chain.
Prepends `new-root-effect` at the start of `target-chain`.
(rechain-effects effects)Given a sequential collection of effects [e1 e2 ... en] in execution order,
re-links them into a continuous pipeline where e1 is root and en is leaf.
Given a sequential collection of effects `[e1 e2 ... en]` in execution order, re-links them into a continuous pipeline where `e1` is root and `en` is leaf.
(remove-by-tag leaf-effect target-tag)Removes all nodes matching target-tag.
Removes all nodes matching `target-tag`.
(remove-effects-by leaf-effect pred)Removes all nodes satisfying pred from the chain and connects surrounding nodes.
Removes all nodes satisfying `pred` from the chain and connects surrounding nodes.
(replace-by-tag leaf-effect target-tag replacement-effect)Replaces the first node matching target-tag with replacement-effect.
Replaces the first node matching `target-tag` with `replacement-effect`.
(replace-effect-by leaf-effect pred replacement-effect)Replaces the first node matching pred with replacement-effect.
Replaces the first node matching `pred` with `replacement-effect`.
(root-effect leaf-effect)Traverses upstream to locate the root (source) effect of the chain.
Traverses upstream to locate the root (source) effect of the chain.
(slice-effects leaf-effect start)(slice-effects leaf-effect start end)Returns a subchain of effects between start (inclusive) and end (exclusive) indices
in execution order.
Returns a subchain of effects between `start` (inclusive) and `end` (exclusive) indices in execution order.
(update-effects-by leaf-effect pred f)Applies (f effect) to all nodes satisfying pred, preserving untouched nodes
and reconstructing the chain.
Applies `(f effect)` to all nodes satisfying `pred`, preserving untouched nodes and reconstructing the chain.
(update-effects-by-tag leaf-effect target-tag f)Applies (f effect) to all nodes matching target-tag.
Applies `(f effect)` to all nodes matching `target-tag`.
(with-scoped-service> service-key service-instance combinator)Wraps a combinator so that it executes within a provided service/context override, restoring the previous context upon completion.
Wraps a combinator so that it executes within a provided service/context override, restoring the previous context upon completion.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |