[commit: haddock] master: Add support for hyperlinking universally quantified type variables. (dd781d1)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:42:12 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/dd781d18eca0d8c28350093d78926d4a9b474827

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

commit dd781d18eca0d8c28350093d78926d4a9b474827
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Jul 1 19:06:04 2015 +0200

    Add support for hyperlinking universally quantified type variables.


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

dd781d18eca0d8c28350093d78926d4a9b474827
 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
index 8777e26..79e31db 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
@@ -99,7 +99,7 @@ types =
 -- clauses).
 binds :: GHC.RenamedSource -> DetailsMap
 binds =
-    everything (<|>) (fun `combine` pat)
+    everything (<|>) (fun `combine` pat `combine` tvar)
   where
     fun term = case cast term of
         (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) ->
@@ -117,6 +117,12 @@ binds =
         (Just (GHC.HsRecField (GHC.L sspan name) (_ :: GHC.LPat GHC.Name) _)) ->
             pure (sspan, RtkVar name)
         _ -> empty
+    tvar term = case cast term of
+        (Just (GHC.L sspan (GHC.UserTyVar name))) ->
+            pure (sspan, RtkBind name)
+        (Just (GHC.L _ (GHC.KindedTyVar (GHC.L sspan name) _))) ->
+            pure (sspan, RtkBind name)
+        _ -> empty
 
 -- | Obtain details map for top-level declarations.
 decls :: GHC.RenamedSource -> DetailsMap



More information about the ghc-commits mailing list