This component represents a way to represent function return values, with a success/failure semantic. Also has several useful macros for dealing with functions that use this component. Example of usage:
(defn foo [] (result/success {:some-data "Hello"}))
(defn notgood [] (result/failure "Not good"))
(if (result/succeeded? foo)
(println "ok")
(println "nok"))
The following macros will only run the body if the results succeed. If any result fails, that result will be the value of the expression.
(result/if-let [r1 foo]
(println "ok")
(println "nok"))
(result/on-success [r1 foo]
(println "ok"))
(result/enforce-let [r1 notgood
r2 foo])
(println "notgoof will be returned"))
(result/enforce-let [r1 notgood
r2 foo
r2 (result/success)])