hoogle
hoogle copied to clipboard
Action/Server: rewrite showFroms to be clearer
(This contains some of the refactor commits from #391, only the last commit changes showFroms substantially)
This pulls apart the display logic and the data munging in showFroms, for ease of understanding.
The resulting code is a bit longer, but uses a nice to understand pipeline of sortOn, groupOn and mapMaybe.
The main complications came from the fact that both the packageName and the targetModule are optional fields, but now it should be fairly straight forward.
cc @smatting
Once https://github.com/ndmitchell/hoogle/pull/391 is merged, this is only one commit.