Elm
Elm copied to clipboard
Add verbose mode to sorting algos
I'd like to propose adding some kind of verbose mode to the sorting algos - if enabled, it prints the list in every step (possibly with some kind of explanatory comment).
Example:
Quick.sort [3, 4, 2] verbose
Output:
sorting [3, 4, 2] -> lt: [2], eq: [], gt: [4], pivot: 3 sorting [2]: already sorted sorting []: already sorted sorting [4]: already sorted result: [2] ++ ([] ++ [3]) ++ [4] = [2, 3, 4]
Would this be useful? If yes, I can start working on a PR.
EDIT On second thoughts, a visual representation (like the Dart Repo provides) might be much more useful (but also harder to implement). I'd love to get feedback on this idea!