aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-03-13 03:03:20 -0700
committerBen Gamari <ben@smart-cactus.org>2017-03-23 17:20:08 -0400
commit26879d9b4a2aba264a10812f2738d4db685d61d1 (patch)
tree0ddafd48d8ba8dc3f48a4c764cd35b886836bf77 /haddock-api/src
parent68e531baa35e698d947686b83525871eb33c3730 (diff)
Add a field marking if interface is a signature or not.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858)
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs1
-rw-r--r--haddock-api/src/Haddock/InterfaceFile.hs6
-rw-r--r--haddock-api/src/Haddock/Types.hs7
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 ff53fd3c..024cd02d 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 0d000029..78853a79 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 8addfa2f..a6dd6354 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -80,6 +80,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
@@ -157,6 +160,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
@@ -186,6 +192,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