[GHC] #12525: Internal identifiers creeping into :show bindings
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: Type: bug | Status: new Priority: low | Milestone: Component: GHCi | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When binding variables the "new" way, or defining typeclasses, some things that are better left unseen manage to creep into the `:show Bindings` list. {{{#!html <pre class="wiki"> GHCi, version 8.1.20160725: http://www.haskell.org/ghc/ :? for help > :show bindings > x = () > :show bindings <b>$trModule :: GHC.Types.Module = _</b> x :: () = _ > class Foo a > :show bindings x :: () = _ class Foo a <b>$tcFoo :: GHC.Types.TyCon = _ $tc'C:Foo :: GHC.Types.TyCon = _ $trModule :: GHC.Types.Module = _</b> </pre> }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: Type: bug | Status: new Priority: low | Milestone: Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Ugh. The underlying problem is that the GHCi `InteractiveContext` doesn't make a proper distinction between * things lexically in scope (`ic_rn_gbl_env :: GlobalRdrEnv`) * things that the typechecker might need (`ic_tythings :: [TyThing]`) Instead the former is (more or less, I think) generated from the latter. But that's problematic for these internal identifiers. We came across this before: #11051. Easiest fix is to use the same solution for `showBindings`, namely to use `isDerivedOccName` to filter out the internal ones. See `Note [What to show to users]` in `InteractiveEval.hs`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: RolandSenn Type: bug | Status: new Priority: low | Milestone: Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: (none) => RolandSenn -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: RolandSenn Type: bug | Status: patch Priority: low | Milestone: 8.8.1 Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime | Test Case: make test performance bug | TEST=T12525 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5326 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * status: new => patch * testcase: => make test TEST=T12525 * differential: => Phab:D5326 * milestone: => 8.8.1 Comment: @simonpj: Many thanks for your kind and helpful hint in [https://ghc.haskell.org/trac/ghc/ticket/12525#comment:1 comment 1]. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: RolandSenn Type: bug | Status: patch Priority: low | Milestone: 8.8.1 Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime | Test Case: make test performance bug | TEST=T12525 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5326 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Krzysztof Gogolewski <krz.gogolewski@…>): In [changeset:"921fd890abe0e7267962c9439098b03c94ebdb9b/ghc" 921fd89/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="921fd890abe0e7267962c9439098b03c94ebdb9b" Fix #12525: Remove derived bindings from the TyThings from getBindings Summary: Remove derived OccNames from the list of TyThings returned by the function GHC.getBindings. Therefore the output of the `:show bindings `command will not contain names generated by GHC. Test Plan: make test TEST=T12525 Reviewers: austin, hvr, alanz, angerman, thomie, bgamari, osa1 Reviewed By: osa1 Subscribers: simonpj, osa1, rwbarton, carter GHC Trac Issues: #12525 Differential Revision: https://phabricator.haskell.org/D5326 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12525: Internal identifiers creeping into :show bindings -------------------------------------+------------------------------------- Reporter: mniip | Owner: RolandSenn Type: bug | Status: closed Priority: low | Milestone: 8.8.1 Component: GHCi | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime | Test Case: make test performance bug | TEST=T12525 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5326 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12525#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC