• Simon Peyton Jones's avatar
    Refactor ConDecl: Trac #14529 · fa29df02
    Simon Peyton Jones authored
    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
    fa29df02
HsUtils.hs 49.4 KB