The Map is a real data structure and has straightforward operations like "add 1 to the value for this key"
No need for weird stuff like toTuple [] = (0, "unknown"); all commands are either in the Map or not
Disadvantage:
I wish I could use Data.Map.toDescList from the containers (notunordered-containers) package but that sorts by key, and all of the keys are the command names, not the count. This is because the counts are not unique (e.g. there are many commands with a count of 1) and so can't be used in the map. So instead, it's stored as an unordered map that is then converted to a list in order to be sorted by value.
Advantages:
toTuple [] = (0, "unknown")
; all commands are either in the Map or notDisadvantage:
Data.Map.toDescList
from thecontainers
(notunordered-containers
) package but that sorts by key, and all of the keys are the command names, not the count. This is because the counts are not unique (e.g. there are many commands with a count of 1) and so can't be used in the map. So instead, it's stored as an unordered map that is then converted to a list in order to be sorted by value.Fixes #15.