You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is, information about thinning and renaming has been lost, which, unfortunately, breaks tools that rely purely on the environment file, such as ghcid. It looks like this should be also fixed on the GHC side, since the package environment files don't seem to support the full thinning and renaming syntax that GHC's -package-id option supports.
23Skidoo
changed the title
.ghc.environment files should support thinning and renaming
.ghc.environment files should probably support thinning and renaming
Mar 26, 2019
I sort of managed to work around this with :set -hide-package base -package "classy-prelude (ClassyPrelude as Prelude)" in .ghci, but then ghcid itself starts producing weird errors:
<interactive>:1:1: error:
Ambiguous module name ‘Prelude’:
it is bound as ClassyPrelude by a package flag
it is bound as base-4.12.0.0:Prelude by package base-4.12.0.0
<interactive>:9:1: error:
Not in scope: ‘INTERNAL_GHCID.putStrLn’
No module named ‘INTERNAL_GHCID’ is imported.
<interactive>:10:1: error:
Not in scope: ‘INTERNAL_GHCID.hPutStrLn’
No module named ‘INTERNAL_GHCID’ is imported.
<interactive>:10:26: error:
Not in scope: ‘INTERNAL_GHCID.stderr’
No module named ‘INTERNAL_GHCID’ is imported.
Anyway, on second thought, this kind of thing should probably be handled by cabal new-repl rather than environment files, though that currently doesn't work that well for me either.
Let's say that I use the following common stanza to replace the standard
Prelude
withClassyPrelude
:This results in approximately the following flags being passed to ghc:
The problem now is that the generated
.ghc.environment
file looks like this:That is, information about thinning and renaming has been lost, which, unfortunately, breaks tools that rely purely on the environment file, such as
ghcid
. It looks like this should be also fixed on the GHC side, since the package environment files don't seem to support the full thinning and renaming syntax that GHC's-package-id
option supports.Related: #5962.
/cc @hvr
The text was updated successfully, but these errors were encountered: