diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-02-06 18:30:35 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-02-06 18:30:35 -0500 |
commit | b995bfe84f9766e23ff78d7ccd520ec7d8cdbebc (patch) | |
tree | 3e7f15ac3b0abe417797ec89275aa1209f6ca297 /haddock-api/src/Haddock/InterfaceFile.hs | |
parent | 9f597b6647a53624eaf501a34bfb4d8d15425929 (diff) | |
parent | 010f0320dff64e3f86091ba4691bc69ce6999647 (diff) |
Merge branch 'wip/ghc-head-merge' into ghc-head
Diffstat (limited to 'haddock-api/src/Haddock/InterfaceFile.hs')
-rw-r--r-- | haddock-api/src/Haddock/InterfaceFile.hs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index 4455f0f8..9c34da54 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -22,9 +22,9 @@ module Haddock.InterfaceFile ( import Haddock.Types -import Haddock.Utils hiding (out) import Control.Monad +import Control.Monad.IO.Class ( MonadIO(..) ) import Data.Array import Data.IORef import Data.List (mapAccumR) @@ -84,7 +84,7 @@ binaryInterfaceMagic = 0xD0Cface -- binaryInterfaceVersion :: Word16 #if MIN_VERSION_ghc(9,1,0) && !MIN_VERSION_ghc(9,2,0) -binaryInterfaceVersion = 34 +binaryInterfaceVersion = 38 binaryInterfaceVersionCompatibility :: [Word16] binaryInterfaceVersionCompatibility = [binaryInterfaceVersion] @@ -702,3 +702,28 @@ instance Binary DocName where name <- get bh return (Undocumented name) _ -> error "get DocName: Bad h" + +instance Binary n => Binary (Wrap n) where + put_ bh (Unadorned n) = do + putByte bh 0 + put_ bh n + put_ bh (Parenthesized n) = do + putByte bh 1 + put_ bh n + put_ bh (Backticked n) = do + putByte bh 2 + put_ bh n + + get bh = do + h <- getByte bh + case h of + 0 -> do + name <- get bh + return (Unadorned name) + 1 -> do + name <- get bh + return (Parenthesized name) + 2 -> do + name <- get bh + return (Backticked name) + _ -> error "get Wrap: Bad h" |