Is there a way to include the function StringPosition["e"] inside the Query in the following:
query=Query[
Histogram[Flatten@#]&,
All,
First
]@*StringPosition["e"]
There are three functions in use here Histogram[Flatten@#]&, First and StringPosition["e"].
Is there a way to rewrite the query in such a way that when compiled it produces the following:
Normal[query]
StringPosition["e"]/*Map[Map[First]]/*(Histogram[Flatten[#1]]&)
I tried rewriting it like as follows:
query=Query[
StringPosition["e"]/*(Histogram[Flatten@#]&),
All,
First
]
But it doesn't compile to the required form:
Normal[query]
Map[Map[First]]/*StringPosition["e"]/*(Histogram[Flatten[#1]]&)
AllandFirstdescending operators so that we get the desired compiled form:Normal @ Query[StringPosition["e"]/*Query[Histogram[Flatten@#]&,All,First]]. – WReach Apr 15 '20 at 23:24