[commit: haddock] 2.17.3.1-spanfix, alexbiehl-patch-1, ghc-8.0, ghc-8.0-facebook, ghc-head, ghc-head1, haddock-quick, headdock-library-1.4.5, ie_avails, issue-303, issue-475, master, pr-filter-maps, pr/cabal-desc, travis, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11028, wip/T11028-2, wip/T11028-3, wip/T11080-open-data-kinds, wip/T11258, wip/T11430, wip/T12105, wip/T12105-2, wip/T12942, wip/T13163, wip/T14529, wip/T3384, wip/embelleshed-rdr, wip/new-tree-one-param, wip/rae, wip/rae-nokinds, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/spj-wildcard-refactor, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: merge with origin/ghc-head (95e4362)

git at git.haskell.org git at git.haskell.org
Tue Nov 28 11:40:35 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: 2.17.3.1-spanfix,alexbiehl-patch-1,ghc-8.0,ghc-8.0-facebook,ghc-head,ghc-head1,haddock-quick,headdock-library-1.4.5,ie_avails,issue-303,issue-475,master,pr-filter-maps,pr/cabal-desc,travis,v2.17,v2.17.3,v2.18,wip-located-module-as,wip/D2418,wip/T11028,wip/T11028-2,wip/T11028-3,wip/T11080-open-data-kinds,wip/T11258,wip/T11430,wip/T12105,wip/T12105-2,wip/T12942,wip/T13163,wip/T14529,wip/T3384,wip/embelleshed-rdr,wip/new-tree-one-param,wip/rae,wip/rae-nokinds,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/spj-wildcard-refactor,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13,wip/ttg6-unrevert-2017-11-22
Link       : http://git.haskell.org/haddock.git/commitdiff/95e4362d9200b31f3f26fe8d2f97b5565e5ab7b3

>---------------------------------------------------------------

commit 95e4362d9200b31f3f26fe8d2f97b5565e5ab7b3
Merge: c091ca8 fcd1bb7
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Nov 23 13:54:31 2015 +0000

    merge with origin/ghc-head



>---------------------------------------------------------------

95e4362d9200b31f3f26fe8d2f97b5565e5ab7b3
 haddock-api/src/Haddock/Backends/Hoogle.hs     |  2 +-
 haddock-api/src/Haddock/Backends/LaTeX.hs      |  4 ++--
 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs |  8 ++++----
 haddock-api/src/Haddock/Convert.hs             |  6 +++---
 haddock-api/src/Haddock/Interface/Create.hs    |  2 +-
 haddock-api/src/Haddock/Interface/Rename.hs    | 10 +++++-----
 haddock-api/src/Haddock/Types.hs               | 13 +++++++------
 7 files changed, 23 insertions(+), 22 deletions(-)

diff --cc haddock-api/src/Haddock/Backends/LaTeX.hs
index 3514f74,c4468c9..4aec791
--- a/haddock-api/src/Haddock/Backends/LaTeX.hs
+++ b/haddock-api/src/Haddock/Backends/LaTeX.hs
@@@ -868,17 -897,19 +868,17 @@@ ppr_mono_lty ctxt_prec ty unicode = ppr
  
  
  ppr_mono_ty :: Int -> HsType DocName -> Bool -> LaTeX
 -ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode
 +ppr_mono_ty ctxt_prec (HsForAllTy tvs ty) unicode
    = maybeParen ctxt_prec pREC_FUN $
 -    hsep [ppForAll expl tvs ctxt' unicode, ppr_mono_lty pREC_TOP ty unicode]
 - where
 -   anonWC :: HsType DocName
 -   anonWC = HsWildCardTy (AnonWildCard (noLoc (Undocumented underscore)))
 -   underscore = mkUnboundName (mkRdrUnqual (mkTyVarOcc "_"))
 -   ctxt'
 -     | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt
 -     | otherwise         = ctxt
 +    sep [ hsep (forallSymbol unicode : ppTyVars tvs) <> dot
 +        , ppr_mono_lty pREC_TOP ty unicode ]
 +ppr_mono_ty ctxt_prec (HsQualTy ctxt ty) unicode
 +  = maybeParen ctxt_prec pREC_FUN $
 +    sep [ ppLContext ctxt unicode
 +        , ppr_mono_lty pREC_TOP ty unicode ]
  
  ppr_mono_ty _         (HsBangTy b ty)     u = ppBang b <> ppLParendType u ty
- ppr_mono_ty _         (HsTyVar name)      _ = ppDocName name
+ ppr_mono_ty _         (HsTyVar (L _ name)) _ = ppDocName name
  ppr_mono_ty ctxt_prec (HsFunTy ty1 ty2)   u = ppr_fun_ty ctxt_prec ty1 ty2 u
  ppr_mono_ty _         (HsTupleTy con tys) u = tupleParens con (map (ppLType u) tys)
  ppr_mono_ty _         (HsKindSig ty kind) u = parens (ppr_mono_lty pREC_TOP ty u <+> dcolon u <+> ppLKind u kind)
diff --cc haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index b0a4f50,328684f..1aa4d95
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@@ -874,16 -873,18 +874,16 @@@ ppr_mono_lty ctxt_prec ty = ppr_mono_t
  
  
  ppr_mono_ty :: Int -> HsType DocName -> Unicode -> Qualification -> Html
 -ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode qual
 -  = maybeParen ctxt_prec pREC_FUN $ ppForAllCon expl tvs ctxt' unicode qual
 -                                    <+> ppr_mono_lty pREC_TOP ty unicode qual
 - where
 -   anonWC = HsWildCardTy (AnonWildCard (noLoc (Undocumented underscore)))
 -   underscore = mkUnboundName (mkRdrUnqual (mkTyVarOcc "_"))
 -   ctxt'
 -     | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt
 -     | otherwise         = ctxt
 +ppr_mono_ty ctxt_prec (HsForAllTy tvs ty) unicode qual
 +  = maybeParen ctxt_prec pREC_FUN $
 +    ppForAllPart tvs unicode <+> ppr_mono_lty pREC_TOP ty unicode qual
 +
 +ppr_mono_ty ctxt_prec (HsQualTy ctxt ty) unicode qual
 +  = maybeParen ctxt_prec pREC_FUN $
 +    ppLContext ctxt unicode qual <+> ppr_mono_lty pREC_TOP ty unicode qual
  
  -- UnicodeSyntax alternatives
- ppr_mono_ty _ (HsTyVar name) True _
+ ppr_mono_ty _ (HsTyVar (L _ name)) True _
    | getOccString (getName name) == "*"    = toHtml "★"
    | getOccString (getName name) == "(->)" = toHtml "(→)"
  
diff --cc haddock-api/src/Haddock/Convert.hs
index ce71cf8,ff34d27..49c471a
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@@ -323,14 -325,12 +323,14 @@@ synifyTyVars ktvs = HsQTvs { hsq_kvs = 
                             , hsq_tvs = map synifyTyVar tvs }
    where
      (kvs, tvs) = partition isKindVar ktvs
 -    synifyTyVar tv
 -      | isLiftedTypeKind kind = noLoc (UserTyVar (noLoc name))
 -      | otherwise             = noLoc (KindedTyVar (noLoc name) (synifyKindSig kind))
 -      where
 -        kind = tyVarKind tv
 -        name = getName tv
 +
 +synifyTyVar :: TyVar -> LHsTyVarBndr Name
 +synifyTyVar tv
-   | isLiftedTypeKind kind = noLoc (UserTyVar name)
++  | isLiftedTypeKind kind = noLoc (UserTyVar (noLoc name))
 +  | otherwise             = noLoc (KindedTyVar (noLoc name) (synifyKindSig kind))
 +  where
 +    kind = tyVarKind tv
 +    name = getName tv
  
  --states of what to do with foralls:
  data SynifyTypeState
@@@ -348,17 -348,8 +348,17 @@@
    --   the defining class gets to quantify all its functions for free!
  
  
 +synifySigType :: SynifyTypeState -> Type -> LHsSigType Name
 +-- The empty binders is a bit suspicious;
 +-- what if the type has free variables?
 +synifySigType s ty = mkEmptyImplicitBndrs (synifyType s ty)
 +
 +synifySigWcType :: SynifyTypeState -> Type -> LHsSigWcType Name
 +-- Ditto (see synifySigType)
 +synifySigWcType s ty = mkEmptyImplicitBndrs (mkEmptyWildCardBndrs (synifyType s ty))
 +
  synifyType :: SynifyTypeState -> Type -> LHsType Name
- synifyType _ (TyVarTy tv) = noLoc $ HsTyVar (getName tv)
+ synifyType _ (TyVarTy tv) = noLoc $ HsTyVar $ noLoc (getName tv)
  synifyType _ (TyConApp tc tys)
    -- Use non-prefix tuple syntax where possible, because it looks nicer.
    | Just sort <- tyConTuple_maybe tc
diff --cc haddock-api/src/Haddock/Interface/Create.hs
index 4d45ff9,349356d..da59c5f
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@@ -810,8 -829,9 +810,8 @@@ extractRecSel nm mdl t tvs (L _ con : r
                                   , L l n <- ns, selectorFieldOcc n == nm ]
    data_ty
      | ResTyGADT _ ty <- con_res con = ty
-     | otherwise = foldl' (\x y -> noLoc (HsAppTy x y)) (noLoc (HsTyVar t)) tvs
+     | otherwise = foldl' (\x y -> noLoc (HsAppTy x y)) (noLoc (HsTyVar (noLoc t))) tvs
  
 -
  -- | Keep export items with docs.
  pruneExportItems :: [ExportItem Name] -> [ExportItem Name]
  pruneExportItems = filter hasDoc
diff --cc haddock-api/src/Haddock/Interface/Rename.hs
index 3640d34,f9edb57..eda5f1b
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@@ -204,17 -198,13 +204,17 @@@ renameMaybeInjectivityAnn = traverse re
  
  renameType :: HsType Name -> RnM (HsType DocName)
  renameType t = case t of
 -  HsForAllTy expl extra tyvars lcontext ltype -> do
 -    tyvars'   <- renameLTyVarBndrs tyvars
 +  HsForAllTy { hst_bndrs = tyvars, hst_body = ltype } -> do
 +    tyvars'   <- mapM renameLTyVarBndr tyvars
 +    ltype'    <- renameLType ltype
 +    return (HsForAllTy { hst_bndrs = tyvars', hst_body = ltype' })
 +
 +  HsQualTy { hst_ctxt = lcontext , hst_body = ltype } -> do
      lcontext' <- renameLContext lcontext
      ltype'    <- renameLType ltype
 -    return (HsForAllTy expl extra tyvars' lcontext' ltype')
 +    return (HsQualTy { hst_ctxt = lcontext', hst_body = ltype' })
  
-   HsTyVar n -> return . HsTyVar =<< rename n
+   HsTyVar (L l n) -> return . HsTyVar . L l =<< rename n
    HsBangTy b ltype -> return . HsBangTy b =<< renameLType ltype
  
    HsAppTy a b -> do



More information about the ghc-commits mailing list