Fork me on GitHub
#specter
<
2023-02-21
>
Carlo16:02:21

I'm doing a specter/select that uses a couple of specter/collect-one, so the general structure of my response is something like:

[[collected-val-00 collected-val-01 result-0]
 [collected-val-10 collected-val-11 result-1]
 ...]
I wonder, could I act on each single vector? Usually I would use a specter/subselect to gather the elements I'm interested in bundling, and a specter/view to finalize the collection, but in this case I can't get subselect to select each single vector. Ideas?

Carlo17:02:56

For now, repurposing an answer by @nathanmarz in this channel, I'm using:

(specter/defrichnav view-with-collected [afn]
  (specter/select* [this vals structure next-fn]
    (next-fn [] (afn vals structure)))
  (specter/transform* [this vals structure next-fn]
    (next-fn [] (afn vals structure))))
I'm curious to know if there are more ideas, and maybe to lobby for inclusion of this function in the library

2