aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/InterfaceFile.hs
diff options
context:
space:
mode:
authorAlexander Biehl <alexbiehl@gmail.com>2018-06-14 15:28:52 +0200
committerGitHub <noreply@github.com>2018-06-14 15:28:52 +0200
commit6247ec8b5a5bc8145ce851dce11eb617a380381c (patch)
tree7856c0dd1ddd0c1f3eef0422b0cd8e8a5a6b71cb /haddock-api/src/Haddock/InterfaceFile.hs
parent9a7f539d0c20654ff394f2ff99836412a6844df1 (diff)
parent095fa970b32c818ed4c06cefc00ba98aaff756fa (diff)
Merge pull request #857 from sjakobi/ghc-head-update-3
Update ghc-head
Diffstat (limited to 'haddock-api/src/Haddock/InterfaceFile.hs')
-rw-r--r--haddock-api/src/Haddock/InterfaceFile.hs43
1 files changed, 40 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index a4e9eb3c..ce6ecc78 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -83,7 +83,7 @@ binaryInterfaceMagic = 0xD0Cface
--
binaryInterfaceVersion :: Word16
#if (__GLASGOW_HASKELL__ >= 805) && (__GLASGOW_HASKELL__ < 807)
-binaryInterfaceVersion = 32
+binaryInterfaceVersion = 33
binaryInterfaceVersionCompatibility :: [Word16]
binaryInterfaceVersionCompatibility = [binaryInterfaceVersion]
@@ -459,9 +459,40 @@ instance Binary a => Binary (Header a) where
t <- get bh
return (Header l t)
+instance Binary a => Binary (Table a) where
+ put_ bh (Table h b) = do
+ put_ bh h
+ put_ bh b
+ get bh = do
+ h <- get bh
+ b <- get bh
+ return (Table h b)
+
+instance Binary a => Binary (TableRow a) where
+ put_ bh (TableRow cs) = put_ bh cs
+ get bh = do
+ cs <- get bh
+ return (TableRow cs)
+
+instance Binary a => Binary (TableCell a) where
+ put_ bh (TableCell i j c) = do
+ put_ bh i
+ put_ bh j
+ put_ bh c
+ get bh = do
+ i <- get bh
+ j <- get bh
+ c <- get bh
+ return (TableCell i j c)
+
instance Binary Meta where
- put_ bh Meta { _version = v } = put_ bh v
- get bh = (\v -> Meta { _version = v }) <$> get bh
+ put_ bh (Meta v p) = do
+ put_ bh v
+ put_ bh p
+ get bh = do
+ v <- get bh
+ p <- get bh
+ return (Meta v p)
instance (Binary mod, Binary id) => Binary (MetaDoc mod id) where
put_ bh MetaDoc { _meta = m, _doc = d } = do
@@ -542,6 +573,9 @@ instance (Binary mod, Binary id) => Binary (DocH mod id) where
put_ bh (DocMathDisplay x) = do
putByte bh 22
put_ bh x
+ put_ bh (DocTable x) = do
+ putByte bh 23
+ put_ bh x
get bh = do
h <- getByte bh
@@ -615,6 +649,9 @@ instance (Binary mod, Binary id) => Binary (DocH mod id) where
22 -> do
x <- get bh
return (DocMathDisplay x)
+ 23 -> do
+ x <- get bh
+ return (DocTable x)
_ -> error "invalid binary data found in the interface file"