Action/Server: rewrite showFroms to be clearer#392
Open
Profpatsch wants to merge 9 commits intondmitchell:masterfrom
Open
Action/Server: rewrite showFroms to be clearer#392Profpatsch wants to merge 9 commits intondmitchell:masterfrom
Profpatsch wants to merge 9 commits intondmitchell:masterfrom
Conversation
Contributor
Author
|
cc @smatting |
The `local` and `haddock` booleans are only used for determining the URLs to generate, so let’s make that clear.
The function does not really deduplicate the elements, it takes and groups. :)
Upstream does not think shadowing should be avoided, so let’s undo the changes to shadowing. Same with incomplete pattern warnings, we’ll just let it crash for now. Also drop the `Is*` prefix for the URL constructors.
CI unfortunately uses -Werror and tests against more modern versions of GHC, so any new errors will only appear on CI.
The way the template was filled was rather hard to follow. This tries to remedy it by splitting the code which infers the data from the list of targets, and the code which generates the HTML. The logic should be exactly the same, but we use a sort->groupBy to stable-sort Targets into their packages.
b6aa989 to
e65973c
Compare
Contributor
Author
|
Once #391 is merged, this is only one commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(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,groupOnandmapMaybe.The main complications came from the fact that both the
packageNameand thetargetModuleare optional fields, but now it should be fairly straight forward.