ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
754 stars 137 forks source link

Action/Server: rewrite showFroms to be clearer #392

Open Profpatsch opened 2 years ago

Profpatsch commented 2 years ago

(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.

Profpatsch commented 2 years ago

cc @smatting

Profpatsch commented 1 year ago

Once https://github.com/ndmitchell/hoogle/pull/391 is merged, this is only one commit.