[GHC] #9988: Remove fun_id, is_infix from FunBind, as they are now in Match

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- One of the changes Phab:D538 introduced is to add m_fun_id_infix to Match {{{#!hs data Match id body = Match { m_fun_id_infix :: (Maybe (Located id,Bool)), -- fun_id and fun_infix for functions with multiple equations -- only present for a RdrName. See note [fun_id in Match] m_pats :: [LPat id], -- The patterns m_type :: (Maybe (LHsType id)), -- A type signature for the result of the match -- Nothing after typechecking m_grhss :: (GRHSs id body) } deriving (Typeable) }}} This was done to track the individual locations and fixity of the fun_id for each of the defining equations for a function when there are more than one. For example, the function (&&&) is defined with some prefix and some infix equations below. {{{#!hs (&&& ) [] [] = [] xs &&& [] = xs ( &&& ) [] ys = ys }}} This means that the fun_id / is_infix is now superfluous in the FunBind. This has not been removed as a potentially risky change just before 7.10 RC2, and so must be done after. This ticket captures that task. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by alanz): * owner: => alanz -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by alanz: Old description:
One of the changes Phab:D538 introduced is to add m_fun_id_infix to Match
{{{#!hs data Match id body = Match { m_fun_id_infix :: (Maybe (Located id,Bool)), -- fun_id and fun_infix for functions with multiple equations -- only present for a RdrName. See note [fun_id in Match] m_pats :: [LPat id], -- The patterns m_type :: (Maybe (LHsType id)), -- A type signature for the result of the match -- Nothing after typechecking m_grhss :: (GRHSs id body) } deriving (Typeable) }}}
This was done to track the individual locations and fixity of the fun_id for each of the defining equations for a function when there are more than one.
For example, the function (&&&) is defined with some prefix and some infix equations below.
{{{#!hs
(&&& ) [] [] = [] xs &&& [] = xs ( &&& ) [] ys = ys }}}
This means that the fun_id / is_infix is now superfluous in the FunBind. This has not been removed as a potentially risky change just before 7.10 RC2, and so must be done after.
This ticket captures that task.
New description: One of the changes Phab:D538 introduced is to add m_fun_id_infix to Match {{{#!hs data Match id body = Match { m_fun_id_infix :: (Maybe (Located id,Bool)), -- fun_id and fun_infix for functions with multiple equations -- only present for a RdrName. See note [fun_id in Match] m_pats :: [LPat id], -- The patterns m_type :: (Maybe (LHsType id)), -- A type signature for the result of the match -- Nothing after typechecking m_grhss :: (GRHSs id body) } deriving (Typeable) }}} This was done to track the individual locations and fixity of the fun_id for each of the defining equations for a function when there are more than one. For example, the function (&&&) is defined with some prefix and some infix equations below. {{{#!hs (&&& ) [] [] = [] xs &&& [] = xs ( &&& ) [] ys = ys }}} This means that the fun_id / is_infix is now superfluous in the FunBind. This has not been removed as a potentially risky change just before 7.10 RC2, and so must be done after. This ticket captures that task, which includes processing these fields through the renamer and beyond. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Actually I'm not sure it'd be a good idea to remove it. It's quite convenient to have the function name in the `FunBind`. But I think we '''can''' (and should) remove `fun_infix` from `FunBind`. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * milestone: => 7.12.1 Comment: I assume this one's targetted for GHC 7.12.1 (rather than GHC 7.10.2?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by alanz): Yes, but I have just realised I may need this functionality, ghc- exactprint may be able to generate output from RenamedSource, which makes HaRe integration easier. If I got it done soon could it hit 7.10.2? I am currently putting a workaround into ghc-exactprint, so it is not critical, but would be cleaner. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): 7.10 is in RC2. We can't keep modifying it otherwise we will never get it out. I suppose that if you have strong reason to believe that you are not introducing new bugs, and having it in is going to transform your life for the better, then you can make the case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by alanz): Phab:D639 refers, which does not close this ticket, but is just the first step toward it. I strongly believe I am not introducing new bugs as it is a simple addition to rnMatch' with pure code that only sets a variable that is ignored in the rest of the compilation process, being introduced specifically for API Annotations. In terms of motivation, the current HaRe model is to do analysis on the RenamedSource, then transform the ParsedSource. Having funcction id locations available in all Match variants is vital. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): I don't object to putting this fix in 7.10. I've looked at the patch. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by alanz): * priority: normal => highest * milestone: 7.12.1 => 7.10.1 Comment: Updating milestone and priority to make 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: D639 -------------------------------------+------------------------------------- Changes (by alanz): * differential: => D639 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: new Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D639 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * differential: D639 => Phab:D639 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D639 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match
-------------------------------------+-------------------------------------
Reporter: alanz | Owner: alanz
Type: task | Status: patch
Priority: highest | Milestone: 7.10.1
Component: Compiler | Version: 7.10.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D639
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: closed Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D639 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged into HEAD and 7.10 - thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: task | Status: closed Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D639 -------------------------------------+------------------------------------- Comment (by alanz): Thanks. I will complete #10061 after GHC 7.10 is out, I am using this time to make sure the API Annotations infrastructure is usable, while there is still an (ever diminishing) chance to do something about it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9988#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9988: Remove fun_id, is_infix from FunBind, as they are now in Match
-------------------------------------+-------------------------------------
Reporter: alanz | Owner: alanz
Type: task | Status: closed
Priority: highest | Milestone: 7.10.1
Component: Compiler | Version: 7.10.1-rc1
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:D639
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC