Liking cljdoc? Tell your friends :D

fx.utils

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.
raw docstring

append-leafclj/s

(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`.
raw docstring

around>clj/s

(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.
raw docstring

ast-seqclj/s

(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.
raw docstring

chain-lengthclj/s

(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.
raw docstring

comp>clj/s

(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.
raw docstring

compose-ast-passesclj/s

(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.
raw docstring

concat-chainsclj/s

(concat-chains & chains)

Concatenates multiple effect chains into a single continuous pipeline.

Concatenates multiple effect chains into a single continuous pipeline.
raw docstring

direct-sub-effectsclj/s

(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).
raw docstring

effect-seqclj/s

(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).
raw docstring

effect-seq-reverseclj/s

(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.
raw docstring

effect-tagsclj/s

(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.
raw docstring

find-all-by-tagclj/s

(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`.
raw docstring

find-all-effectsclj/s

(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.
raw docstring

find-first-by-tagclj/s

(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.
raw docstring

find-first-effectclj/s

(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.
raw docstring

insert-after-tagclj/s

(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`.
raw docstring

insert-before-tagclj/s

(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`.
raw docstring

insert-effect-afterclj/s

(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`.
raw docstring

insert-effect-beforeclj/s

(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`.
raw docstring

map-effectsclj/s

(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.
raw docstring

pipe-fx-fn>clj/s

(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])`.
raw docstring

pipe>clj/s

(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.
raw docstring

prepend-rootclj/s

(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`.
raw docstring

rechain-effectsclj/s

(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.
raw docstring

remove-by-tagclj/s

(remove-by-tag leaf-effect target-tag)

Removes all nodes matching target-tag.

Removes all nodes matching `target-tag`.
raw docstring

remove-effects-byclj/s

(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.
raw docstring

replace-by-tagclj/s

(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`.
raw docstring

replace-effect-byclj/s

(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`.
raw docstring

root-effectclj/s

(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.
raw docstring

slice-effectsclj/s

(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.
raw docstring

update-effects-byclj/s

(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.
raw docstring

update-effects-by-tagclj/s

(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`.
raw docstring

with-scoped-service>clj/s

(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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close