[commit: haddock] wip/orf-reboot: Get rid of erroneous DocNames for underscore when pretty-printing (f1befea)
git at git.haskell.org
git at git.haskell.org
Mon Nov 20 20:55:51 UTC 2017
- Previous message: [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, mpickering/import, pr-filter-maps, pr/cabal-desc, travis, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11017, wip/T11019, 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/T3384, wip/embelleshed-rdr, wip/import2, wip/new-tree-one-param, wip/orf-reboot, wip/rae, wip/rae-nokinds, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/spj-wildcard-refactor, wip/spj-wildcard-refactor2, 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: s/PackageKey/UnitId/g and s/packageKey/unitId/g (c7a8a8b)
- Next message: [commit: haddock] wip/orf-reboot: Get rid of erroneous DocNames for underscore when pretty-printing (f1befea)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Repository : ssh://git@git.haskell.org/haddock
On branch : wip/orf-reboot
Link : http://git.haskell.org/haddock.git/commitdiff/f1befeaacc630ca9fa11d316b429ecae571f91ca
>---------------------------------------------------------------
commit f1befeaacc630ca9fa11d316b429ecae571f91ca
Author: Adam Gundry <adam at well-typed.com>
Date: Tue Oct 13 18:29:19 2015 +0100
Get rid of erroneous DocNames for underscore when pretty-printing
>---------------------------------------------------------------
f1befeaacc630ca9fa11d316b429ecae571f91ca
haddock-api/src/Haddock/Backends/LaTeX.hs | 7 +++++--
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs
index 2895006..68149b4 100644
--- a/haddock-api/src/Haddock/Backends/LaTeX.hs
+++ b/haddock-api/src/Haddock/Backends/LaTeX.hs
@@ -24,9 +24,10 @@ import qualified Pretty
import GHC
import OccName
import Name ( nameOccName )
-import RdrName ( rdrNameOcc )
+import RdrName ( rdrNameOcc, mkRdrUnqual )
import FastString ( unpackFS, unpackLitString, zString )
import Outputable ( panic)
+import PrelNames ( mkUnboundName )
import qualified Data.Map as Map
import System.Directory
@@ -900,7 +901,9 @@ ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode
= maybeParen ctxt_prec pREC_FUN $
hsep [ppForAll expl tvs ctxt' unicode, ppr_mono_lty pREC_TOP ty unicode]
where
- anonWC = HsWildCardTy (AnonWildCard (error "ppr_mono_ty: anonWC")) -- AMG TODO is this okay?
+ anonWC :: HsType DocName
+ anonWC = HsWildCardTy (AnonWildCard (Undocumented underscore))
+ underscore = mkUnboundName (mkRdrUnqual (mkTyVarOcc "_"))
ctxt'
| Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt
| otherwise = ctxt
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index a6e6186..f94daab 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -38,7 +38,8 @@ import GHC
import GHC.Exts
import Name
import BooleanFormula
-import RdrName ( rdrNameOcc )
+import RdrName ( rdrNameOcc, mkRdrUnqual )
+import PrelNames ( mkUnboundName )
ppDecl :: Bool -> LinksInfo -> LHsDecl DocName
-> DocForDecl DocName -> [DocInstance DocName] -> [(DocName, Fixity)]
@@ -875,7 +876,8 @@ 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 (error "ppr_mono_ty: anonWC")) -- AMG TODO ?
+ anonWC = HsWildCardTy (AnonWildCard (Undocumented underscore))
+ underscore = mkUnboundName (mkRdrUnqual (mkTyVarOcc "_"))
ctxt'
| Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt
| otherwise = ctxt
- Previous message: [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, mpickering/import, pr-filter-maps, pr/cabal-desc, travis, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11017, wip/T11019, 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/T3384, wip/embelleshed-rdr, wip/import2, wip/new-tree-one-param, wip/orf-reboot, wip/rae, wip/rae-nokinds, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/spj-wildcard-refactor, wip/spj-wildcard-refactor2, 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: s/PackageKey/UnitId/g and s/packageKey/unitId/g (c7a8a8b)
- Next message: [commit: haddock] wip/orf-reboot: Get rid of erroneous DocNames for underscore when pretty-printing (f1befea)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ghc-commits
mailing list