diagnose
diagnose copied to clipboard
Remove dependency on unordered-containers
This lightens the dependency footprint of
diagnose by dropping the dependency on
unordered-containers.
This dependency removal seems less clear than the others. Some sort of Map is what’s desired here, so implementing the relevant functions locally on top of [] seems like the wrong way to go.
Maybe an argument could be made to use a Map (probably lazy?) from containers instead, since it’s already in the dependency graph and included with GHC anyway?
But restricting existing [] to NonEmpty when possible seems like a good change.
If it's just groupOn, then I would prefer a local implementation (or one imported from a lightweight library like extra), to using unordered-containers, but that's very much a personal preference. You can close this issue if you prefer another side of the trade-off :)
Hello, sorry for the long silence.
I don't really know why I used unordered-containers in the first place, where it is used now. It most likely came with a bit more usage here and here, which I may have removed over the years.
Now the remaining uses of HashMaps do not really rely on the invariants of the structure itself: using Map instead of HashMap everywhere should not pose a problem. Not sure if those maps should be lazy or not though. It may perhaps be better for the map storing file contents, but not for those storing markers in the rendering.