This ns provides a set of helpers to handle an abstraction similar to Either in Haskell.
The main goal is to provide a mechanism similar to the exceptions, albeit pure - without Java Exceptions.
When a function returns a Result - it either contains a result of a successful outcome or an error with a
common error structure (JwtError).
The let-either macro provides a monadic syntax.
Mainly:
(let-either [result-value-1 (fn-returning-a-result-1 ,,,)
result-value-2 (fn-returning-a-result-2 ,,,)
,,,]
,,,)
if fn-returning-a-result-1 returns an error then we will not execute the rest of the let-either.
And return the full result.
This ns provides a set of helpers to handle an abstraction similar to Either in Haskell.
The main goal is to provide a mechanism similar to the exceptions, albeit pure - without Java Exceptions.
When a function returns a `Result` - it either contains a result of a successful outcome or an error with a
common error structure (`JwtError`).
The `let-either` macro provides a monadic syntax.
Mainly:
```
(let-either [result-value-1 (fn-returning-a-result-1 ,,,)
result-value-2 (fn-returning-a-result-2 ,,,)
,,,]
,,,)
```
if `fn-returning-a-result-1` returns an error then we will not execute the rest of the let-either.
And return the full `result`.
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 |