recursion-ninja pushed to branch wip/26626 at Glasgow Haskell Compiler / GHC

Commits:

6 changed files:

Changes:

  • compiler/GHC/Hs/Type.hs
    ... ... @@ -72,7 +72,7 @@ module GHC.Hs.Type (
    72 72
             mkHsWildCardBndrs, mkHsPatSigType, mkHsTyPat,
    
    73 73
             mkEmptyWildCardBndrs,
    
    74 74
             mkHsForAllVisTele, mkHsForAllInvisTele,
    
    75
    -        mkHsQTvs, emptyLHsQTvs,
    
    75
    +        mkHsQTvs, hsQTvExplicit, emptyLHsQTvs,
    
    76 76
             isHsKindedTyVar, hsBndrVar, hsBndrKind, hsTvbAllKinded,
    
    77 77
             hsScopedTvs, hsScopedKvs, hsWcScopedTvs, dropWildCards,
    
    78 78
             hsTyVarLName, hsTyVarName,
    
    ... ... @@ -640,6 +640,9 @@ hsLTyVarName = hsTyVarName . unLoc
    640 640
     hsLTyVarNames :: [LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
    
    641 641
     hsLTyVarNames = mapMaybe hsLTyVarName
    
    642 642
     
    
    643
    +hsQTvExplicit :: LHsQTyVars (GhcPass p) -> [LHsTyVarBndr (HsBndrVis (GhcPass p)) (GhcPass p)]
    
    644
    +hsQTvExplicit = hsq_explicit
    
    645
    +
    
    643 646
     hsForAllTelescopeBndrs :: HsForAllTelescope (GhcPass p) -> [LHsTyVarBndr ForAllTyFlag (GhcPass p)]
    
    644 647
     hsForAllTelescopeBndrs (HsForAllVis   _ bndrs) = map (fmap (setHsTyVarBndrFlag Required)) bndrs
    
    645 648
     hsForAllTelescopeBndrs (HsForAllInvis _ bndrs) = map (fmap (updateHsTyVarBndrFlag Invisible)) bndrs
    
    ... ... @@ -650,7 +653,7 @@ hsForAllTelescopeNames (HsForAllInvis _ bndrs) = hsLTyVarNames bndrs
    650 653
     
    
    651 654
     hsExplicitLTyVarNames :: LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
    
    652 655
     -- Explicit variables only
    
    653
    -hsExplicitLTyVarNames qtvs = hsLTyVarNames (hsq_explicit qtvs)
    
    656
    +hsExplicitLTyVarNames qtvs = hsLTyVarNames (hsQTvExplicit qtvs)
    
    654 657
     
    
    655 658
     hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
    
    656 659
     -- All variables
    
    ... ... @@ -664,7 +667,7 @@ hsLTyVarLocName (L _ a) = hsTyVarLName a
    664 667
     
    
    665 668
     hsLTyVarLocNames :: Anno (IdGhcP p) ~ SrcSpanAnnN
    
    666 669
                      => LHsQTyVars (GhcPass p) -> [LocatedN (IdP (GhcPass p))]
    
    667
    -hsLTyVarLocNames qtvs = mapMaybe hsLTyVarLocName (hsq_explicit qtvs)
    
    670
    +hsLTyVarLocNames qtvs = mapMaybe hsLTyVarLocName (hsQTvExplicit qtvs)
    
    668 671
     
    
    669 672
     -- | Get the kind signature of a type, ignoring parentheses:
    
    670 673
     --
    

  • compiler/GHC/Rename/HsType.hs
    ... ... @@ -922,7 +922,7 @@ bindHsQTyVars doc mb_assoc body_kv_occs hsq_bndrs thing_inside
    922 922
                                   , hsq_explicit  = rn_bndrs })
    
    923 923
                           body_remaining } }
    
    924 924
       where
    
    925
    -    hs_tv_bndrs = hsq_explicit hsq_bndrs
    
    925
    +    hs_tv_bndrs = hsQTvExplicit hsq_bndrs
    
    926 926
     
    
    927 927
         -- The SrcSpan of the LHsQTyVars. For example, bndrs_loc would be the
    
    928 928
         -- highlighted part in the class below:
    

  • utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
    ... ... @@ -33,6 +33,7 @@ import GHC
    33 33
     import GHC.Core.InstEnv
    
    34 34
     import qualified GHC.Driver.DynFlags as DynFlags
    
    35 35
     import GHC.Driver.Ppr
    
    36
    +import GHC.Hs.Type (hsQTvExplicit)
    
    36 37
     import GHC.Plugins (TopLevelFlag (..))
    
    37 38
     import GHC.Types.SourceText
    
    38 39
     import GHC.Unit.State
    
    ... ... @@ -330,7 +331,7 @@ ppCtor sDocContext dat subdocs con@ConDeclH98{con_args = con_args'} =
    330 331
           apps $
    
    331 332
             map reL $
    
    332 333
               (HsTyVar noAnn NotPromoted (reL (noUserRdr $ tcdName dat)))
    
    333
    -            : map (tyVarArg . unLoc) (hsq_explicit $ tyClDeclTyVars dat)
    
    334
    +            : map (tyVarArg . unLoc) (hsQTvExplicit $ tyClDeclTyVars dat)
    
    334 335
     ppCtor
    
    335 336
       sDocContext
    
    336 337
       _dat
    

  • utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
    ... ... @@ -435,7 +435,7 @@ ppFamHeader
    435 435
             | associated = id
    
    436 436
             | otherwise = (<+> keyword "family")
    
    437 437
     
    
    438
    -      famName = ppAppDocNameTyVarBndrs unicode name (hsq_explicit tvs)
    
    438
    +      famName = ppAppDocNameTyVarBndrs unicode name (hsQTvExplicitBinders tvs)
    
    439 439
     
    
    440 440
           famSig = case result of
    
    441 441
             NoSig _ -> empty
    

  • utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
    ... ... @@ -467,7 +467,7 @@ ppTySyn
    467 467
           hdr =
    
    468 468
             hsep
    
    469 469
               ( [keyword "type", ppBinder summary occ]
    
    470
    -              ++ ppTyVars unicode qual (hsq_explicit ltyvars)
    
    470
    +              ++ ppTyVars unicode qual (hsQTvExplicitBinders ltyvars)
    
    471 471
               )
    
    472 472
           full = hdr <+> def
    
    473 473
           def = case unLoc ltype of
    
    ... ... @@ -594,7 +594,7 @@ ppFamHeader
    594 594
       qual =
    
    595 595
         hsep
    
    596 596
           [ ppFamilyLeader associated info
    
    597
    -      , ppAppDocNameTyVarBndrs summary unicode qual name (hsq_explicit tvs)
    
    597
    +      , ppAppDocNameTyVarBndrs summary unicode qual name (hsQTvExplicitBinders tvs)
    
    598 598
           , ppResultSig result unicode qual
    
    599 599
           , injAnn
    
    600 600
           , whereBit
    
    ... ... @@ -759,7 +759,7 @@ ppClassHdr
    759 759
     ppClassHdr summ lctxt n tvs fds unicode qual =
    
    760 760
       keyword "class"
    
    761 761
         <+> (if not (null $ fromMaybeContext lctxt) then ppLContext lctxt unicode qual HideEmptyContexts else noHtml)
    
    762
    -    <+> ppAppDocNameTyVarBndrs summ unicode qual n (hsq_explicit tvs)
    
    762
    +    <+> ppAppDocNameTyVarBndrs summ unicode qual n (hsQTvExplicitBinders tvs)
    
    763 763
         <+> ppFds fds unicode qual
    
    764 764
     
    
    765 765
     ppFds :: [LHsFunDep DocNameI] -> Unicode -> Qualification -> Html
    
    ... ... @@ -1655,7 +1655,7 @@ ppDataHeader
    1655 1655
           ppLContext ctxt unicode qual HideEmptyContexts
    
    1656 1656
           <+>
    
    1657 1657
           -- T a b c ..., or a :+: b
    
    1658
    -      ppAppDocNameTyVarBndrs summary unicode qual name (hsq_explicit tvs)
    
    1658
    +      ppAppDocNameTyVarBndrs summary unicode qual name (hsQTvExplicitBinders tvs)
    
    1659 1659
           <+> case ks of
    
    1660 1660
             Nothing -> mempty
    
    1661 1661
             Just (L _ x) -> dcolon unicode <+> ppKind unicode qual x
    

  • utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
    ... ... @@ -47,6 +47,7 @@ import GHC.Core.Type (binderVar, isRuntimeRepVar)
    47 47
     import GHC.Data.StringBuffer (StringBuffer)
    
    48 48
     import qualified GHC.Data.StringBuffer as S
    
    49 49
     import GHC.Driver.Session
    
    50
    +import GHC.Hs.Type (hsQTvExplicit)
    
    50 51
     import GHC.HsToCore.Docs hiding (sigNameNoLoc)
    
    51 52
     import GHC.Types.Name
    
    52 53
     import GHC.Types.SrcLoc (advanceSrcLoc)
    
    ... ... @@ -333,9 +334,12 @@ lHsQTyVarsToTypes tvs =
    333 334
       [ HsValArg noExtField $ noLocA (case hsLTyVarName tv of
    
    334 335
           Nothing -> HsWildCardTy noExtField
    
    335 336
           Just nm -> HsTyVar noAnn NotPromoted (noLocA $ noUserRdr nm))
    
    336
    -  | tv <- hsq_explicit tvs
    
    337
    +  | tv <- hsQTvExplicit tvs
    
    337 338
       ]
    
    338 339
     
    
    340
    +hsQTvExplicitBinders :: LHsQTyVars DocNameI -> [LHsTyVarBndr (HsBndrVis DocNameI) DocNameI]
    
    341
    +hsQTvExplicitBinders = hsq_explicit 
    
    342
    +
    
    339 343
     --------------------------------------------------------------------------------
    
    340 344
     
    
    341 345
     -- * Making abstract declarations