[GHC] #12382: Rename clasing type variables more consistently
#12382: Rename clasing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature | Status: new request | Priority: low | Milestone: Component: Compiler | Version: 8.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is minor polishing, but polish is nice: Consider {{{ :t (id,id,id) (id,id,id) :: (a -> a, a1 -> a1, a2 -> a2) }}} this looks as if the first `a` is in some way better or more important. What I’d like to see is {{{ :t (id,id,id) (id,id,id) :: (a1 -> a2, a2 -> a2, a3 -> a3) }}} In other words: If two type variables clash and need to be renamed, then rename both (all) of them. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clasing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): I am having a hard time finding the place where the renaming happens. If that code looks at the type (or at least all type variables bound together) as a whole this might be quite easy. If it just adds one variable by another, without being able to rename the existing ones, it might be hard. Can someone point me to the rough area of the code? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clasing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Ah, it seems to be `tidyOccName` in `basicTypes/OccName`. I’ll see what can be done here. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clasing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Beware of recent performance fixes around `tidyOccName` (changeset:c89bd681d34d3339771ebdde8aa468b1d9ab042b/ghc), which unfortunately does not come with a performance test case. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clasing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Fun fact: HEAD hands out numbers in an unexpected order: {{{ Prelude> :t (id,id,id) (id,id,id) :: (a2 -> a2, a1 -> a1, a -> a) }}} This was the other (better?) way around in 7.10. Did not check 8.0. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clashing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clashing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: nomeata Type: feature request | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * owner: => nomeata Comment: Some preparational work in `wip/T12382`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clashing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: nomeata Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2402 Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * status: new => patch * differential: => Phab:D2402 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clashing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: nomeata Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2402 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Joachim Breitner <mail@…>): In [changeset:"18ac80ff729eb19ec370ead9f9275b3bc32c1f81/ghc" 18ac80ff/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="18ac80ff729eb19ec370ead9f9275b3bc32c1f81" tidyType: Rename variables of nested forall at once this refactoring commit prepares for fixing #12382, which can now be implemented soley in tidyTyCoVarBndrs. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12382: Rename clashing type variables more consistently -------------------------------------+------------------------------------- Reporter: nomeata | Owner: nomeata Type: feature request | Status: closed Priority: low | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2402 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed * milestone: => 8.2.1 Comment: commit cd0750ec96fba9b1683b25954092439c0f267fd7 {{{ Author: Joachim Breitner <mail@joachim-breitner.de> Date: Tue Jul 12 17:21:07 2016 +0200 tidyOccNames: Rename variables fairly So that > :t (id,id,id) produces (id,id,id) :: (a3 -> a3, a2 -> a2, a1 -> a1) instead of (id,id,id) :: (a2 -> a2, a1 -> a1, a -> a) Differential Revision: https://phabricator.haskell.org/D2402 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12382#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC