[GHC] #14529: Refactor ConDecl

GHC ghc-devs at haskell.org
Thu Dec 7 17:50:11 UTC 2017


#14529: Refactor ConDecl
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      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 Simon Peyton Jones <simonpj@…>):

 In [changeset:"fa29df02a1b0b926afb2525a258172dcbf0ea460/ghc"
 fa29df02/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="fa29df02a1b0b926afb2525a258172dcbf0ea460"
 Refactor ConDecl: Trac #14529

 This patch refactors HsDecls.ConDecl.  Specifically

 * ConDeclGADT was horrible, with all the information hidden
   inside con_res_ty.  Now it's kept separate, as it should be.

 * ConDeclH98: use [LHsTyVarBndr] instead of LHsQTyVars for the
   existentials. There is no implicit binding here.

 * Add a field con_forall to both ConDeclGADT and ConDeclH98
   which says if there is an explicit user-written forall.

 * Field renamings in ConDecl
      con_cxt     to con_mb_cxt
      con_details to con_args

 There is an accompanying submodule update to Haddock.

 Also the following change turned out to remove a lot of clutter:

 * add a smart constructor for HsAppsTy, namely mkHsAppsTy,
   and use it consistently. This avoids a lot of painful pattern
   matching for the common singleton case.

 Two api-annotation tests (T10278, and T10399) are broken, hence marking
 them as expect_broken(14529).  Alan is going to fix them, probably by
 changing the con_forall field to
    con_forall :: Maybe SrcSpan
 instead of Bool
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14529#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list