[commit: haddock] wip/ast-prepare-annotations-final4: Replace head with case/panic (ef4f3bf)
git at git.haskell.org
git at git.haskell.org
Wed Jul 8 08:33:27 UTC 2015
Repository : ssh://git@git.haskell.org/haddock
On branch : wip/ast-prepare-annotations-final4
Link : http://git.haskell.org/haddock.git/commitdiff/ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139
>---------------------------------------------------------------
commit ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date: Tue Nov 18 21:49:28 2014 +0200
Replace head with case/panic
>---------------------------------------------------------------
ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139
src/Haddock/Backends/LaTeX.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs
index d7469c9..ec3ea8d 100644
--- a/src/Haddock/Backends/LaTeX.hs
+++ b/src/Haddock/Backends/LaTeX.hs
@@ -26,6 +26,7 @@ import OccName
import Name ( nameOccName )
import RdrName ( rdrNameOcc )
import FastString ( unpackFS, unpackLitString, zString )
+import Outputable ( panic)
import qualified Data.Map as Map
import System.Directory
@@ -676,8 +677,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) =
forall = con_explicit con
-- don't use "con_doc con", in case it's reconstructed from a .hi file,
-- or also because we want Haddock to do the doc-parsing, not GHC.
- mbDoc = lookup (unLoc $ head $ con_names con) subdocs >>=
- combineDocumentation . fst
+ mbDoc = case con_names con of
+ [] -> panic "empty con_names"
+ (cn:_) -> lookup (unLoc cn) subdocs >>=
+ combineDocumentation . fst
mkFunTy a b = noLoc (HsFunTy a b)
More information about the ghc-commits
mailing list