ndmitchell / hoogle

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

Action/Server refactors #391

Open Profpatsch opened 1 year ago

Profpatsch commented 1 year ago

A bunch of refactors that fell out of a study session of the module list generation code.

The original goal (at Munihac) was to change the sort order, so that the home module of a target is listed first, but we didn’t get that far.

So this is a bunch of refactors that do not (or should not) change any behavior. Any changes will be submitted in separate PRs.

Profpatsch commented 1 year ago

cc @smatting

Profpatsch commented 1 year ago

Okay, I addressed all the comments I think.

ndmitchell commented 1 year ago

I seem to be getting failures on newer GHC:

src/Action/Server.hs:217:21: error: [-Wincomplete-uni-patterns, -Werror=incomplete-uni-patterns]
Error:     Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns of type ‘[Target]’ not matched: []
    |
217 |     forM_ results $ \is@(Target{..}:_) -> do
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^...

Happy with removing the wall, or fixing it. Also wouldn't be averse to using NonEmpty in the right places to fix it too.

Profpatsch commented 1 year ago

Ah yeah, must have improved the exhaustiveness checking. Will fix

Profpatsch commented 1 year ago

I opted for removing -Wall for now since I think it would interfere with the other PR’s commits too much and lead to a big rebase.

Profpatsch commented 1 year ago

ok looks like the others are unrelated

on MacOS:

FAILED ON MAC
{"message":"API rate limit exceeded for 199.7.166.17. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

on Ubuntu:

cabal: Failed to build wai-logger-2.4.0. The failure occurred during the
configure step. The exception was:
dieVerbatim: user error (cabal: '/home/runner/.ghcup/bin/ghc' exited with an
error:
/home/runner/.cabal/store/ghc-9.0.2/cabal-doctest-1.0.9-c5067c39fbeb5bff36b6ed7706ee31a87e1421142e9fe6d94eb8209fc65f5188/lib/libHScabal-doctest-1.0.9-c5067c39fbeb5bff36b6ed7706ee31a87e1421142e9fe6d94eb8209fc65f5188.a(Doctest.o)(.text+0x3066):
error: undefined reference to
'base_GHCziShow_zdfShowZLz2cUZRzuzdcshowList1_closure'
…
Profpatsch commented 1 year ago

Okay, I might have some time to work on these again, I rebased. I think most of the comments have been fixed, PTAL.

Profpatsch commented 1 year ago

Now all CI runs fail because of the copyright year :(