[Git][ghc/ghc][wip/T25281] More

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Mon Oct 7 22:05:28 UTC 2024



Simon Peyton Jones pushed to branch wip/T25281 at Glasgow Haskell Compiler / GHC


Commits:
cada7c27 by Simon Peyton Jones at 2024-10-07T22:38:04+01:00
More

- - - - -


2 changed files:

- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs


Changes:

=====================================
utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
=====================================
@@ -362,7 +362,7 @@ ppFamDecl
   -> Bool
   -- ^ unicode
   -> LaTeX
-ppFamDecl associated doc instances decl unicode =
+ppFamDecl associated doc instances decl@(FamDecl{}) unicode =
   declWithDoc
     (ppFamHeader (tcdFam decl) unicode associated <+> whereBit)
     (if null body then Nothing else Just (vcat body))
@@ -401,6 +401,9 @@ ppFamDecl associated doc instances decl unicode =
 
     instancesBit = ppDocInstances unicode instances
 
+ppFamDecl _ _ _ _ _ = error "ppFamDecl"
+  -- Should never be called on a non-FamDecl
+
 -- | Print the LHS of a type\/data family declaration.
 ppFamHeader
   :: FamilyDecl DocNameI
@@ -811,10 +814,11 @@ ppInstDecl :: Bool -> InstHead DocNameI -> LaTeX
 ppInstDecl unicode (InstHead{..}) = case ihdInstType of
   ClassInst ctx _ _ _ -> keyword "instance" <+> ppContextNoLocs ctx unicode <+> typ
   TypeInst rhs -> keyword "type" <+> keyword "instance" <+> typ <+> tibody rhs
-  DataInst dd ->
+  DataInst dd@(DataDecl {}) ->
     let cons = dd_cons (tcdDataDefn dd)
         pref = case cons of NewTypeCon _ -> keyword "newtype"; DataTypeCons _ _ -> keyword "data"
      in pref <+> keyword "instance" <+> typ
+  DataInst _ -> error "ppInstDecl"
   where
     typ = ppAppNameTypes ihdClsName ihdTypes unicode
     tibody = maybe empty (\t -> equals <+> ppType unicode t)
@@ -849,7 +853,7 @@ ppDataDecl
   -> Bool
   -- ^ unicode
   -> LaTeX
-ppDataDecl pats instances subdocs doc dataDecl unicode =
+ppDataDecl pats instances subdocs doc dataDecl@(DataDecl {}) unicode =
   declWithDoc
     (ppDataHeader dataDecl unicode <+> whereBit)
     (if null body then Nothing else Just (vcat body))
@@ -890,6 +894,8 @@ ppDataDecl pats instances subdocs doc dataDecl unicode =
               $$ text "\\end{tabulary}\\par"
 
     instancesBit = ppDocInstances unicode instances
+ppDataDecl _ _ _ _ _ _ = error "ppDataDecl"
+  -- Should never be called on a non-DataDecl
 
 -- ppConstrHdr is for (non-GADT) existentials constructors' syntax
 ppConstrHdr


=====================================
utils/haddock/haddock-api/src/Haddock/Types.hs
=====================================
@@ -886,7 +886,7 @@ type instance XBndrNoKind DocNameI = NoExtField
 type instance XXBndrKind DocNameI = DataConCantHappen
 
 type instance XCFieldOcc DocNameI = DocName
-type instance XXFieldOcc DocNameI = NoExtField
+type instance XXFieldOcc DocNameI = DataConCantHappen
 
 type instance XFixitySig DocNameI = NoExtField
 type instance XFixSig DocNameI = NoExtField
@@ -941,6 +941,7 @@ type instance XClassDecl DocNameI = NoExtField
 type instance XDataDecl DocNameI = NoExtField
 type instance XSynDecl DocNameI = NoExtField
 type instance XFamDecl DocNameI = NoExtField
+type instance XXHsDataDefn DocNameI = DataConCantHappen
 type instance XXFamilyDecl DocNameI = DataConCantHappen
 type instance XXTyClDecl DocNameI = DataConCantHappen
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cada7c27b8a6227999f586d877c2fe2e0730ef7a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cada7c27b8a6227999f586d877c2fe2e0730ef7a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241007/67dfb1ba/attachment-0001.html>


More information about the ghc-commits mailing list