aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
index 7b66c566..d315ced0 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
@@ -19,7 +19,7 @@ import System.Directory
import System.FilePath
import GHC.Iface.Ext.Types ( HieFile(..), HieASTs(..) )
-import GHC.Iface.Ext.Binary ( readHieFile, hie_file_result)
+import GHC.Iface.Ext.Binary ( readHieFile, hie_file_result, NameCacheUpdater(..))
import Data.Map as M
import GHC.Data.FastString ( mkFastString )
import GHC.Unit.Module ( Module, moduleName )
@@ -56,12 +56,14 @@ ppHyperlinkedModuleSource srcdir pretty srcs iface = case ifaceHieFile iface of
Just hfp -> do
-- Parse the GHC-produced HIE file
u <- mkSplitUniqSupply 'a'
+ let nc = (initNameCache u [])
+ ncu = NCU $ \f -> pure $ snd $ f nc
HieFile { hie_hs_file = file
, hie_asts = HieASTs asts
, hie_types = types
, hie_hs_src = rawSrc
- } <- (hie_file_result . fst)
- <$> (readHieFile (initNameCache u []) hfp)
+ } <- hie_file_result
+ <$> (readHieFile ncu hfp)
-- Get the AST and tokens corresponding to the source file we want
let mast | M.size asts == 1 = snd <$> M.lookupMin asts