[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.16, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11080-open-data-kinds, wip/T11258, wip/T11430, wip/T12105, wip/T12105-2, wip/T12942, wip/T13163, wip/T3384, wip/embelleshed-rdr, wip/new-tree-one-param, wip/rae, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, 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: Get rid of no longer neccessary instance specification type. (dc62b95)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 20:51: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.16,v2.17,v2.17.3,v2.18,wip-located-module-as,wip/D2418,wip/T11080-open-data-kinds,wip/T11258,wip/T11430,wip/T12105,wip/T12105-2,wip/T12942,wip/T13163,wip/T3384,wip/embelleshed-rdr,wip/new-tree-one-param,wip/rae,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,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
Link       : http://git.haskell.org/haddock.git/commitdiff/dc62b95d18c61fc0bf7c8d4c49d23a240af32568

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

commit dc62b95d18c61fc0bf7c8d4c49d23a240af32568
Author: Ɓukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Thu Jul 23 19:27:24 2015 +0200

    Get rid of no longer neccessary instance specification type.


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

dc62b95d18c61fc0bf7c8d4c49d23a240af32568
 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 35 +++++++++++++-------------
 haddock-api/src/Haddock/Types.hs               |  6 -----
 2 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index a894972..34da4ba 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -282,7 +282,7 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode
       = subEquations qual $ map (ppTyFamEqn . unLoc) eqns
 
       | otherwise
-      = ppInstances links instances Nothing docname splice unicode qual
+      = ppInstances links instances docname splice unicode qual
 
     -- Individual equation of a closed type family
     ppTyFamEqn TyFamEqn { tfe_tycon = n, tfe_rhs = rhs
@@ -506,38 +506,37 @@ ppClassDecl summary links instances fixities loc d subdocs
     ppMinimal p (Or fs) = wrap $ foldr1 (\a b -> a+++" | "+++b) $ map (ppMinimal False) fs
       where wrap | p = parens | otherwise = id
 
-    instSpec = Just $ InstSpec { ispecSigs = sigs, ispecTyVars = ltyvars }
-    instancesBit = ppInstances links instances instSpec nm splice unicode qual
+    instancesBit = ppInstances links instances nm splice unicode qual
 
 ppClassDecl _ _ _ _ _ _ _ _ _ _ _ = error "declaration type not supported by ppShortClassDecl"
 
 
 ppInstances :: LinksInfo
-            -> [DocInstance DocName] -> Maybe (InstSpec DocName) -> DocName
+            -> [DocInstance DocName] -> DocName
             -> Splice -> Unicode -> Qualification
             -> Html
-ppInstances links instances mspec baseName splice unicode qual
+ppInstances links instances baseName splice unicode qual
   = subInstances qual instName links True (zipWith instDecl [1..] instances)
   -- force Splice = True to use line URLs
   where
     instName = getOccString $ getName baseName
     instDecl :: Int -> DocInstance DocName -> (SubDecl,Located DocName)
     instDecl iid (inst, maybeDoc,l) =
-        ((ppInstHead links splice unicode qual iid mspec inst, maybeDoc, []),l)
+        ((ppInstHead links splice unicode qual iid inst, maybeDoc, []),l)
 
 
 ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification
-           -> Int -> Maybe (InstSpec DocName) -> InstHead DocName
+           -> Int -> InstHead DocName
            -> Html
-ppInstHead links splice unicode qual iid mspec ihead@(InstHead {..}) =
+ppInstHead links splice unicode qual iid (InstHead {..}) =
     case ihdInstType of
-        ClassInst cs _ _ | Just spec <- mspec ->
-            subClsInstance (nameStr ++ "-" ++ show iid) hdr (mets spec ihead)
+        ClassInst { .. } ->
+            subClsInstance (nameStr ++ "-" ++ show iid) hdr mets
           where
-            hdr = ppContextNoLocs cs unicode qual <+> typ
+            hdr = ppContextNoLocs clsiCtx unicode qual <+> typ
             mets = ppInstanceSigs links splice unicode qual
+                clsiTyVars ihdTypes clsiSigs
             nameStr = occNameString . nameOccName $ getName ihdClsName
-        ClassInst cs _ _ -> ppContextNoLocs cs unicode qual <+> typ
         TypeInst rhs -> keyword "type" <+> typ
             <+> maybe noHtml (\t -> equals <+> ppType unicode qual t) rhs
         DataInst dd -> keyword "data" <+> typ
@@ -547,15 +546,15 @@ ppInstHead links splice unicode qual iid mspec ihead@(InstHead {..}) =
 
 
 ppInstanceSigs :: LinksInfo -> Splice -> Unicode -> Qualification
-              -> InstSpec DocName -> InstHead DocName
+              -> LHsTyVarBndrs DocName -> [HsType DocName] -> [Sig DocName]
               -> [Html]
-ppInstanceSigs links splice unicode qual (InstSpec {..}) (InstHead {..}) = do
-    TypeSig lnames (L loc typ) _ <- ispecSigs
+ppInstanceSigs links splice unicode qual bndrs tys sigs = do
+    TypeSig lnames (L loc typ) _ <- sigs
     let names = map unLoc lnames
-    let typ' = rename' . sugar $ specializeTyVarBndrs ispecTyVars ihdTypes typ
+    let typ' = rename' . sugar $ specializeTyVarBndrs bndrs tys typ
     return $ ppSimpleSig links splice unicode qual loc names typ'
   where
-    fv = foldr Set.union Set.empty . map freeVariables $ ihdTypes
+    fv = foldr Set.union Set.empty . map freeVariables $ tys
     rename' = rename fv
 
 
@@ -628,7 +627,7 @@ ppDataDecl summary links instances fixities subdocs loc doc dataDecl
                                      (map unLoc (con_names (unLoc c)))) fixities
       ]
 
-    instancesBit = ppInstances links instances Nothing docname
+    instancesBit = ppInstances links instances docname
         splice unicode qual
 
 
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 0c130cb..b4a4102 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -352,12 +352,6 @@ data InstHead name = InstHead
     , ihdInstType :: InstType name
     }
 
--- | Instance details used for printing specialized method signatures.
-data InstSpec name = InstSpec
-    { ispecTyVars :: LHsTyVarBndrs name
-    , ispecSigs :: [Sig name]
-    }
-
 -----------------------------------------------------------------------------
 -- * Documentation comments
 -----------------------------------------------------------------------------



More information about the ghc-commits mailing list