toUnfoldable currently leaks structure by doing a breadth-first traversal of the Map.
Potential solutions, subsequent to benchmarking:
-
If it turns out that toUnfoldable really isn't faster than toAscUnfoldable, then toUnfoldable = toAscUnfoldable should be a simple fix. It would break anything that was depending on the order of toUnfoldable, which is not what people should be doing. Maybe you also deprecate toAscUnfoldable.
-
Put some sort of constraint on toUnfoldable to ensure that it unfolds to a structure where ordering is not important?
-
Place a strongly worded, ugly warning comment on toUnfoldable.
Other ideas?
toUnfoldablecurrently leaks structure by doing a breadth-first traversal of theMap.Potential solutions, subsequent to benchmarking:
If it turns out that
toUnfoldablereally isn't faster thantoAscUnfoldable, thentoUnfoldable = toAscUnfoldableshould be a simple fix. It would break anything that was depending on the order oftoUnfoldable, which is not what people should be doing. Maybe you also deprecatetoAscUnfoldable.Put some sort of constraint on
toUnfoldableto ensure that it unfolds to a structure where ordering is not important?Place a strongly worded, ugly warning comment on
toUnfoldable.Other ideas?