spekk.util.flatten

spekk.util.flatten#

flatten() flattens a tree-like data structure into a list of tree-like data structures given a dimension and a spec, such that each item in the list either does not contain the dimension or it contains ONLY the dimension. In effect, we are de-structuring the data structure such that it becomes possible to easily loop over the dimension for arbitrary data structures.