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

GHC ghc-devs at haskell.org
Thu Jan 15 07:28:26 UTC 2015


#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


More information about the ghc-tickets mailing list