anomalies
failjure
anomalies | failjure | |
---|---|---|
3 | 5 | |
174 | 401 | |
0.0% | - | |
10.0 | 1.1 | |
over 5 years ago | 8 months ago | |
Clojure | Clojure | |
- | Eclipse Public License 1.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
anomalies
-
Clojure in the Tyre Manufacturing Industry
I'll do my best but there might be better explanations around the web.
I think an illustrative example would be this repo:
https://github.com/cognitect-labs/anomalies
These are basically re-usable, namespaced keywords. You might decide to use them or something similar in your program/system and some people do. Pretty neat: Their semantics are documented in the readme and the little bit of code in the repo defines a spec here https://github.com/cognitect-labs/anomalies/blob/master/src/....
You can read it as: any map that has these keywords as defined in the spec is an "anomaly".
Specs are open, non-exclusive so you can add more stuff to your structure and they still conform. (Note that the double colon before the keywords just mean "the current namespace defined at the top".)
Note that you don't need to define a spec for namespaced keywords. It's just a utility that leverages them. By themselves they already say "I can be used in a global context".
---
These keywords can be used from anywhere and by themselves. You don't need to carry around their context for them to work or have meaning. To contrast: for example a JSON field in a nested context might only make sense in that specific nesting context. Clojure namespaces are by convention globally unique.
Some examples:
- `:my.domain.accounting/refnumber`
- `:my.domain.ui/color` defined as `(or :my.domain.ui/rgb :my.domain.ui/hsl)` etc.
- `:my.domain.person/name` defined as a string if at all
- `:my.domain.event/type`
-
How to handle errors or failed computations in clojure?
In this case i would typically use an exception which is caught at the layer that is calling into my handler, whether that's a standard ring handler or interceptor. I'd use exceptions similar to those describe in the cognitect anomalies library and map those to an error response at the level interacting with the request and calling my handler.
failjure
-
Errors From Libraries (part 4/4)
Ohh I wasn't aware of failjure. That would have fit the previous post quite nicely. :)
-
How to handle errors or failed computations in clojure?
https://github.com/adambard/failjure provides an error monad. I never use it.
-
Clojure for someone who's only seen statically typed languages?
3) Railway programming: clojure is made of a simple core and added functionality in provided through library.For railway programming there is failjure, flow, rop, either..
-
Probably easy question: alternatives to early return
In particular the `reduced` and `reduced?` functions are the silver bullet I was looking for. Also very interesting is the failjure library, but it seems to prefer short-circuiting by default, and adding your own break-points, as /u/joinr has done brilliantly above isn't obvious to me as a beginner.
What are some alternatives?
farolero - Thread-safe Common Lisp style conditions and restarts for Clojure(Script) and Babashka.
vcvrack-packone - Modules for VCV Rack
flow - Functional (and opinionated) errors handling in Clojure
anomalies-tools - Anomalies handling tools
rop - Yet another Railway Oriented Programming in Clojure
unless_modules
PurefunctionPipelineDataflow - My Blog: The Math-based Grand Unified Programming Theory: The Pure Function Pipeline Data Flow with principle-based Warehouse/Workshop Model
penpot - Penpot: The open-source design tool for design and code collaboration