Hmm I would expect the results to be based on the data structure holding the values you&#x27;re flattening. An in-order depth first traversal if the data structure you&#x27;re applying it to has an inherent order (e.g a List) and in an undefined order if it&#x27;s something unordered like a Set.<p><pre><code>  List(List(1,2), List(3,4), List(5,6)).flatten -&gt; List(1, 2, 3, 4, 5, 6)
  Set(Set(1,2), Set(3,4), Set(5,6)).flatten -&gt; Set(5, 1, 6, 2, 3, 4)</code></pre>