Liking cljdoc? Tell your friends :D

fmnoise.flow


callclj/s

(call f & args)

Calls given function with supplied args in try/catch block, then calls Catch.caught on caught exception. If no exception has caught during function call returns its result

Calls given function with supplied args in `try/catch` block, then calls `Catch.caught` on caught exception. If no exception has caught during function call returns its result
sourceraw docstring

call-withclj/s

(call-with catch-handler f & args)

Calls given function with supplied args in try/catch block, then calls catch-handler on caught exception. If no exception has caught during function call returns its result

Calls given function with supplied args in `try/catch` block, then calls catch-handler on caught exception. If no exception has caught during function call returns its result
sourceraw docstring

Catchclj/sprotocol

caughtclj/s

(caught t)

defines how to process caught exception

defines how to process caught exception
source

chainclj/s

(chain v f & fs)

Passes given value through chain of functions. If value is an error or any function in chain returns error, it's returned and rest of chain is skipped

Passes given value through chain of functions. If value is an error or any function in chain returns error, it's returned and rest of chain is skipped
sourceraw docstring

elseclj/s

(else f)
(else f value)

If value is an error, applies f to it, otherwise returns value

If value is an error, applies f to it, otherwise returns value
sourceraw docstring

else-callclj/s

(else-call f)
(else-call f value)

If value is an error, applies f to it wrapped to call, otherwise returns value

If value is an error, applies f to it wrapped to `call`, otherwise returns value
sourceraw docstring

else-ifclj

(else-if err-class f)
(else-if err-class f value)

If value is an error of err-class (or any of its parents), applies f to it, otherwise returns value

If value is an error of err-class (or any of its parents), applies f to it, otherwise returns value
sourceraw docstring

ex-info!clj/s

(ex-info! & args)

Functional wrapper for creating and throwing ex-info

Functional wrapper for creating and throwing ex-info
sourceraw docstring

fail-withclj/s≠

clj
(fail-with {:keys [msg data cause suppress? trace?]
            :or {data {} suppress? false trace? false}
            :as options})

Constructs Fail with given options. Stacktrace is disabled by default

Constructs `Fail` with given options. Stacktrace is disabled by default
cljs
(fail-with {:keys [msg data cause] :or {data {}} :as options})

Constructs ex-info with given options

Constructs `ex-info` with given options
source (clj)source (cljs)raw docstring

fail-with!clj/s≠

(fail-with! {:keys [trace?] :or {trace? true} :as options})
clj

Constructs Fail with given options and throws it. Stacktrace is enabled by default.

Constructs `Fail` with given options and throws it. Stacktrace is enabled by default.
cljs

Constructs ex-info with given options and throws it. Stacktrace is enabled by default.

Constructs ex-info with given options and throws it. Stacktrace is enabled by default.
sourceraw docstring

fail?clj/s

(fail? t)

Checks if given value is considered as failure

Checks if given value is considered as failure
sourceraw docstring

fletclj/smacro

(flet bindings & body)

Flow adaptation of Clojure let. Wraps evaluation of each binding to call-with with default handler (defined with Catch.caught). If value returned from binding evaluation is failure, it's returned immediately and all other bindings and body are skipped.

Flow adaptation of Clojure `let`. Wraps evaluation of each binding to `call-with` with default handler (defined with `Catch.caught`). If value returned from binding evaluation is failure, it's returned immediately and all other bindings and body are skipped.
sourceraw docstring

Flowclj/sprotocol

?errclj/s

(?err this f)

if value is an error, apply f to it, otherwise return value

if value is an error, apply f to it, otherwise return value

?okclj/s

(?ok this f)

if value is not an error, apply f to it, otherwise return value

if value is not an error, apply f to it, otherwise return value

?throwclj/s

(?throw this)

if value is an error, throw it, otherwise return value

if value is an error, throw it, otherwise return value
source

handleclj/s

(handle opts)
(handle {:keys [ok err] :or {ok identity err identity}} value)

Accepts map with :ok, :err keys and a value. If value is an error, runs :err on it, else runs :ok. Both keys default to identity

Accepts map with :ok, :err keys and a value. If value is an error, runs :err on it, else runs :ok. Both keys default to `identity`
sourceraw docstring

selectclj/s

(select f coll)
(select f fallback-f coll)

Processes given collection with given function and returns first non-failure result. If all results are failures, returns nil. Accepts optional 2nd argument with function which will be called on processed collection when no non-failure result was returned. Always returns nil when collection is empty.

Processes given collection with given function and returns first non-failure result. If all results are failures, returns nil. Accepts optional 2nd argument with function which will be called on processed collection when no non-failure result was returned. Always returns nil when collection is empty.
sourceraw docstring

thenclj/s

(then f)
(then f value)

If value is not an error, applies f to it, otherwise returns value

If value is not an error, applies f to it, otherwise returns value
sourceraw docstring

then-callclj/s

(then-call f)
(then-call f value)

If value is not an error, applies f to it wrapped to call, otherwise returns value

If value is not an error, applies f to it wrapped to `call`, otherwise returns value
sourceraw docstring

thruclj/s

(thru f)
(thru f value)

Applies f to value (for side effects). Returns value. Works similar to doto, but accepts function as first arg

Applies f to value (for side effects). Returns value. Works similar to `doto`, but accepts function as first arg
sourceraw docstring

thru-callclj/s

(thru-call f)
(thru-call f value)

Applies f to value wrapped to call (for side effects). Returns value. Works similar to doto, but accepts function as first arg. Please not that exception thrown inside of function will be silently ignored by default

Applies f to value wrapped to `call` (for side effects). Returns value. Works similar to `doto`, but accepts function as first arg. Please not that exception thrown inside of function will be silently ignored by default
sourceraw docstring

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

× close