Suppose we have a structure like this:
[ :a [:a :b :c] [:a [:b1 :b2] :c ] ]
That is a *required* list. It consists of keywords and *paths* (nested
vector like [:a :b :c] above). A path consists of keywords and
*alternates* (a twice-nested vector like [:b1 :b2]) above.
It's easy to descend this by hand and keep track of which "type" of
vector you're dealing with. However, this sort of thing comes up enough
that it would be convenient if there were a function that takes a
grammar and a structure and returns that structure annotated (metadata?)
with type information. Coupled with Specter
https://github.com/nathanmarz/specter, that would make a good number of
data transformations easy-peasy.
Is there such a library? Or a library I can build on? A quick scan shows
a lot of parsers for dealing with strings, but we've already got one of
those: it's called `read`.
@marick