Pipelines with error handling in Clojure

I'm looking for a smart way to create composite validation and transformation protocols in Clojure. The goal is to be able to perform simple translation and verification of messages using composite steps.

Primary requirements:

  • It can be composed functionally , i.e. conveyors are pure features
  • Can be applied to regular Clojure data types (maps, vectors, lists, and their nested combinations)
  • It can perform conversions , for example. rename the key on the card.
  • It can perform arbitrary checks (for example, by applying a circuit check for part of a message)
  • Can gracefully help out when errors are detected and return a meaningful error message (and not just an exception!)

I think I can write all this, but I don’t really want to reinvent the wheel today :-)

Does anyone know a tool that can do this, or do you have a good idea on how to build it in a smart and general way?

+6
source share
1 answer

You can look at the Zach Tellman Lamina library . You can create pipelines functions with error handlers as other useful functions.

+1
source

All Articles