Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 0750672

Browse files
committed
Update for UniqFM changes.
1 parent 9bd65ee commit 0750672

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

haddock-api/src/Haddock/InterfaceFile.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-}
2+
{-# LANGUAGE BangPatterns #-}
23
{-# OPTIONS_GHC -fno-warn-orphans #-}
34
-----------------------------------------------------------------------------
45
-- |
@@ -276,7 +277,7 @@ putName BinSymbolTable{
276277

277278
data BinSymbolTable = BinSymbolTable {
278279
bin_symtab_next :: !FastMutInt, -- The next index to use
279-
bin_symtab_map :: !(IORef (UniqFM (Int,Name)))
280+
bin_symtab_map :: !(IORef (UniqFM Name (Int,Name)))
280281
-- indexed by Name
281282
}
282283

@@ -286,24 +287,24 @@ putFastString BinDictionary { bin_dict_next = j_r,
286287
bin_dict_map = out_r} bh f
287288
= do
288289
out <- readIORef out_r
289-
let unique = getUnique f
290-
case lookupUFM out unique of
290+
let !unique = getUnique f
291+
case lookupUFM_Directly out unique of
291292
Just (j, _) -> put_ bh (fromIntegral j :: Word32)
292293
Nothing -> do
293294
j <- readFastMutInt j_r
294295
put_ bh (fromIntegral j :: Word32)
295296
writeFastMutInt j_r (j + 1)
296-
writeIORef out_r $! addToUFM out unique (j, f)
297+
writeIORef out_r $! addToUFM_Directly out unique (j, f)
297298

298299

299300
data BinDictionary = BinDictionary {
300301
bin_dict_next :: !FastMutInt, -- The next index to use
301-
bin_dict_map :: !(IORef (UniqFM (Int,FastString)))
302+
bin_dict_map :: !(IORef (UniqFM FastString (Int,FastString)))
302303
-- indexed by FastString
303304
}
304305

305306

306-
putSymbolTable :: BinHandle -> Int -> UniqFM (Int,Name) -> IO ()
307+
putSymbolTable :: BinHandle -> Int -> UniqFM Name (Int,Name) -> IO ()
307308
putSymbolTable bh next_off symtab = do
308309
put_ bh next_off
309310
let names = elems (array (0,next_off-1) (eltsUFM symtab))
@@ -346,7 +347,7 @@ fromOnDiskName _ nc (pid, mod_name, occ) =
346347
}
347348

348349

349-
serialiseName :: BinHandle -> Name -> UniqFM (Int,Name) -> IO ()
350+
serialiseName :: BinHandle -> Name -> UniqFM Name (Int,Name) -> IO ()
350351
serialiseName bh name _ = do
351352
let modu = nameModule name
352353
put_ bh (moduleUnit modu, moduleName modu, nameOccName name)

0 commit comments

Comments
 (0)