Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,246
    • Issues 5,246
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 570
    • Merge requests 570
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2182
Closed
Open
Issue created Mar 28, 2008 by claus.reinke@talk21.com@trac-claus.reinke

GHC sessions (--make, --interactive, GHC API) erroneously retain instances

The EPS (external-package state) is only ever increased, never decreased between compilation of different modules in a single batch compilation or GHCi session.

Example 1 (GHCi):

ezyang@sabre:~/Dev/labs/ezyangest$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> (\x -> x)

<interactive>:2:1:
    No instance for (Show (t0 -> t0)) arising from a use of `print'
    Possible fix: add an instance declaration for (Show (t0 -> t0))
    In a stmt of an interactive GHCi command: print it
Prelude> :m +Text.Show.Functions
Prelude Text.Show.Functions> (\x -> x)
<function>
Prelude Text.Show.Functions> :m -Text.Show.Functions
Prelude> :r
Ok, modules loaded: none.
Prelude> (\x -> x)
<function>

Example 2 (make):

ezyang@sabre:~/Dev/labs/ezyangest$ cat A.hs
module A where
import Text.Show.Functions
ezyang@sabre:~/Dev/labs/ezyangest$ cat B.hs
module B where
y = show (\x -> x)
ezyang@sabre:~/Dev/labs/ezyangest$ ghc --make B.hs A.hs
[1 of 2] Compiling A                ( A.hs, A.o )
[2 of 2] Compiling B                ( B.hs, B.o )
ezyang@sabre:~/Dev/labs/ezyangest$ ghc --make A.hs B.hs -fforce-recomp
[1 of 2] Compiling B                ( B.hs, B.o )

B.hs:2:5:
    No instance for (Show (t0 -> t0)) arising from a use of `show'
    Possible fix: add an instance declaration for (Show (t0 -> t0))
    In the expression: show (\ x -> x)
    In an equation for `y': y = show (\ x -> x)
Edited Apr 29, 2022 by John Ericson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking