camfort / fortran-src

Fortran parsing and static analysis infrastructure
https://hackage.haskell.org/package/fortran-src
Other
48 stars 20 forks source link

Fix GHC 9.6 build #290

Closed raehik closed 2 months ago

raehik commented 2 months ago

Also updates Nix flake.

No code changes, only singletons package bound tweaks and import tweaks.

raehik commented 2 months ago

This adds a bunch of redundant imports for GHC <9.6. I propose this doesn't matter. I only know how to sidestep it with CPP (which is a very silly idea here). My usual solution is to add a comment on the import line so it shows up in the warning, which I've done here.

raehik commented 2 months ago

I'm confident the new warnings are self-describing enough to merge this without any extra pairs of eyes. If you sift through the build warnings, you'll see some 8 of these:

src/Language/Fortran/Analysis/ModGraph.hs:14:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad’ is redundant
      except perhaps to import instances from ‘Control.Monad’
    To import instances alone, use: import Control.Monad()
   |
14 | import Control.Monad ( forM_ ) -- required for mtl-2.3 (GHC 9.6)

We can't disable a warning for a code block. We could disable it for a module, but I don't love that.