Liking cljdoc? Tell your friends :D

funlines.core

A tiny pipeline library that helps untangle a series of steps, where each step possibly depends on the output of previous steps, and each result should be checked for errors before continuing.

Pipeline functions can signal an error by returning the result of calling failure. There is no need to wrap successful values.

A tiny pipeline library that helps untangle a series of steps, where each step
possibly depends on the output of previous steps, and each result should be
checked for errors before continuing.

Pipeline functions can signal an error by returning the result of calling
`failure`. There is no need to wrap successful values.
raw docstring

failureclj/s

(failure message & [data props])

Construct a pipeline function failure. Pass in a string message, and optional data, which will be available under :funlines.core/error-data. Even more optionally, pass in a map of props that will be merged onto the resulting map.

Construct a pipeline function failure. Pass in a string message, and optional
`data`, which will be available under `:funlines.core/error-data`. Even more
optionally, pass in a map of `props` that will be merged onto the resulting
map.
sourceraw docstring

failure->clj/smacro

(failure-> x & forms)

Threads the pipeline failure x through the forms. If x is not a pipeline failure, it is returned directly.

Threads the pipeline failure `x` through the forms. If `x` is not a pipeline
failure, it is returned directly.
sourceraw docstring

failure->>clj/smacro

(failure->> x & forms)

Threads the pipeline failure x through the forms. If x is not a pipeline failure, it is returned directly.

Threads the pipeline failure `x` through the forms. If `x` is not a pipeline
failure, it is returned directly.
sourceraw docstring

ok->clj/smacro

(ok-> x & forms)

Threads the successful pipeline result x through the forms. If x is a pipeline failure, it is returned directly.

Threads the successful pipeline result `x` through the forms. If `x` is a
pipeline failure, it is returned directly.
sourceraw docstring

ok->>clj/smacro

(ok->> x & forms)

Threads the successful pipeline result x through the forms. If x is a pipeline failure, it is returned directly.

Threads the successful pipeline result `x` through the forms. If `x` is a
pipeline failure, it is returned directly.
sourceraw docstring

ok?clj/s

(ok? res)

Given the result of a pipeline function, or indeed a full pipeline run, check for success.

Given the result of a pipeline function, or indeed a full pipeline run, check
for success.
sourceraw docstring

runclj/s

(run steps & [ctx])

Run a pipeline, passing in an optional initial context. A pipeline is a sequence of steps, each step a pair of [keyword function]. The function will be called with a single argument, a context map. The function's return value will be assoc-ed to the context map under the keyword from the tuple. The new context will be passed to the next pair.

Returns either the first failing step in a map of {:funlines.core/ok? false, :funlines.core/step step-kw} and possibly more information about the error (see funlines.core/failure) or the resulting context map after all steps have succeeded.

Run a pipeline, passing in an optional initial context. A pipeline is a
sequence of steps, each step a pair of [keyword function]. The function will
be called with a single argument, a `context` map. The function's return value
will be assoc-ed to the context map under the keyword from the tuple. The new
context will be passed to the next pair.

Returns either the first failing step in a map of
`{:funlines.core/ok? false, :funlines.core/step step-kw}` and possibly more
information about the error (see `funlines.core/failure`) or the resulting
context map after all steps have succeeded.
sourceraw docstring

run-someclj/s

(run-some step-fns & [ctx])

Runs step functions until a successful result is obtained, then returns it. step-fns is a sequence of functions. Optionally pass in a ctx that will be passed to the functions. If no steps are successful then the failure result from the final step is returned.

Runs step functions until a successful result is obtained, then returns it.
`step-fns` is a sequence of functions. Optionally pass in a `ctx` that will be
passed to the functions. If no steps are successful then the failure result
from the final step is returned.
sourceraw docstring

run-stepclj/s

(run-step f ctx)

Run a single step, representing exceptions as pipeline failures.

Run a single step, representing exceptions as pipeline failures.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close