[commit: haddock] ghc-head, ghc-head1, haddock-quick, ie_avails, wip/new-tree-one-param, 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: Add a field marking if interface is a signature or not. (930cfbe)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 21:05:15 UTC 2017


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

On branches: ghc-head,ghc-head1,haddock-quick,ie_avails,wip/new-tree-one-param,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/930cfbe58e2e87f5a4d431d89a3c204934e6e858

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

commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Mar 13 03:03:20 2017 -0700

    Add a field marking if interface is a signature or not.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

930cfbe58e2e87f5a4d431d89a3c204934e6e858
 haddock-api/src/Haddock/Interface/Create.hs | 1 +
 haddock-api/src/Haddock/InterfaceFile.hs    | 6 ++++--
 haddock-api/src/Haddock/Types.hs            | 7 +++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 5112360..60843ee 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -132,6 +132,7 @@ createInterface tm flags modMap instIfaceMap = do
 
   return $! Interface {
     ifaceMod             = mdl
+  , ifaceIsSig           = Module.isHoleModule sem_mdl
   , ifaceOrigFilename    = msHsFilePath ms
   , ifaceInfo            = info
   , ifaceDoc             = Documentation mbDoc modWarn
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index 0e8e1e0..796a7ce 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -372,9 +372,10 @@ instance Binary InterfaceFile where
 
 
 instance Binary InstalledInterface where
-  put_ bh (InstalledInterface modu info docMap argMap
+  put_ bh (InstalledInterface modu is_sig info docMap argMap
            exps visExps opts subMap fixMap) = do
     put_ bh modu
+    put_ bh is_sig
     put_ bh info
     put_ bh docMap
     put_ bh argMap
@@ -386,6 +387,7 @@ instance Binary InstalledInterface where
 
   get bh = do
     modu    <- get bh
+    is_sig  <- get bh
     info    <- get bh
     docMap  <- get bh
     argMap  <- get bh
@@ -395,7 +397,7 @@ instance Binary InstalledInterface where
     subMap  <- get bh
     fixMap  <- get bh
 
-    return (InstalledInterface modu info docMap argMap
+    return (InstalledInterface modu is_sig info docMap argMap
             exps visExps opts subMap fixMap)
 
 
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 1f44622..e48acab 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -78,6 +78,9 @@ data Interface = Interface
     -- | The module behind this interface.
     ifaceMod             :: !Module
 
+    -- | Is this a signature?
+  , ifaceIsSig           :: !Bool
+
     -- | Original file name of the module.
   , ifaceOrigFilename    :: !FilePath
 
@@ -155,6 +158,9 @@ data InstalledInterface = InstalledInterface
     -- | The module represented by this interface.
     instMod            :: Module
 
+    -- | Is this a signature?
+  , instIsSig          :: Bool
+
     -- | Textual information about the module.
   , instInfo           :: HaddockModInfo Name
 
@@ -184,6 +190,7 @@ data InstalledInterface = InstalledInterface
 toInstalledIface :: Interface -> InstalledInterface
 toInstalledIface interface = InstalledInterface
   { instMod            = ifaceMod            interface
+  , instIsSig          = ifaceIsSig          interface
   , instInfo           = ifaceInfo           interface
   , instDocMap         = ifaceDocMap         interface
   , instArgMap         = ifaceArgMap         interface



More information about the ghc-commits mailing list