Fork me on GitHub
#specter
<
2017-08-28
>
alexyakushev19:08:43

Hi, I remember I saw something somewhere about Specter supporting iteration over multiple sequences (like Clojure's map does). Maybe, it was an explanation why Specter doesn't have this; anyway, I can't find the link. Can anyone help? A pointer how to work around this problem would be nice too. Thanks!

nathanmarz19:08:49

@alexyakushev no, Specter doesn't support that

nathanmarz19:08:18

besides questions of how to do a performant implementation of that, there's questions of semantics too

nathanmarz19:08:43

for instance, what would an ALL transform on a vector and a map produce?

alexyakushev20:08:43

@nathanmarz Yeah, I thought it was something along these lines. map was always an outlier among other sequence processing functions, it makes sense that Specter doesn't have it. Regarding my problem, I need to merge two lists of lists of lists of maps. Without Specter, I solved it with an abhorrent lasagna of (partial map ...). Can Specter help here somehow?

nathanmarz20:08:09

I had an idea open awhile ago that would have helped, or an extension of it https://github.com/nathanmarz/specter/issues/49

nathanmarz20:08:48

basically you locate the specific paths to elements you care about, then use the element-specific path to get the corresponding value in the other data structure

nathanmarz20:08:21

locate is complicated to implement especially for substructure navigators like srange

nathanmarz20:08:10

I hadn't thought before about how something like locate would help with processing multiple data structures together

alexyakushev20:08:53

@nathanmarz Thanks! This is still quite helpful.

nathanmarz20:08:05

I ended up implementing something different than locate as described in that ticket, but this might be worth considering again

nathanmarz20:08:39

Having a broader set of use cases would be needed to understand how to spec the new operation