specter

Latest version: 1.1.3
okocim 2018-09-20T15:47:09.000100Z

I’m a complete novice with specter (fired it up about a day ago), but I’m liking it so far. One thing that strikes me about the library is that it lends itself very well when you’re trying to simulate an “update in place” of a complex data structure. However, when I’m trying to completely change the shape of one data structure into a different structure (e.g. for transformation at a contract boundary), I find myself fighting with it a bit more. Am I right in my thinking that this is more suited for changing values in an existing data structure, or was this library also intended to help reshape data structures, and I’m not yet understanding which of the helpers are used for that. What I’ve been doing to date is calling select and collecting the values that I’m interested in, and then simply arranging the collected values into whatever shape I need. Is that the right approach?

nathanmarz 2018-09-20T17:05:28.000100Z

@okocim you have it right, specter excels at doing partial changes of a data structure

nathanmarz 2018-09-20T17:05:55.000100Z

if you're restructuring the whole thing, specter probably won't help that much

okocim 2018-09-20T18:32:18.000100Z

@nathanmarz Thanks for confirming, and thanks for the library. The partial update use-case is the one that I primarily used this for, and it really does feel like you’re providing a piece that’s missing in core clojure :thumbsup: