aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/InterfaceFile.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2012-02-04 21:37:16 +0100
committerDavid Waern <david.waern@gmail.com>2012-02-04 21:43:49 +0100
commit12d931b4c3fcd6d8e26cc48b9072b4291efa5cdb (patch)
treee9e035574c5b9571a2ceaad5de33939c5bf04bfd /src/Haddock/InterfaceFile.hs
parentac8e218ba6407fc826fc54e0f1b7ac23c0c6b338 (diff)
Mostly hlint-inspired cleanup.
Diffstat (limited to 'src/Haddock/InterfaceFile.hs')
-rw-r--r--src/Haddock/InterfaceFile.hs34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs
index e998ffec..970093df 100644
--- a/src/Haddock/InterfaceFile.hs
+++ b/src/Haddock/InterfaceFile.hs
@@ -22,24 +22,25 @@ module Haddock.InterfaceFile (
import Haddock.Types
import Haddock.Utils hiding (out)
-import Data.List
-import Data.Word
+import Control.Monad
import Data.Array
import Data.IORef
+import Data.List
import qualified Data.Map as Map
import Data.Map (Map)
+import Data.Word
-import GHC hiding (NoLink)
-import Binary
import BinIface (getSymtabName, getDictFastString)
-import Name
-import UniqSupply
-import UniqFM
-import IfaceEnv
-import HscTypes
-import GhcMonad (withSession)
+import Binary
import FastMutInt
import FastString
+import GHC hiding (NoLink)
+import GhcMonad (withSession)
+import HscTypes
+import IfaceEnv
+import Name
+import UniqFM
+import UniqSupply
import Unique
@@ -110,8 +111,8 @@ writeInterfaceFile filename iface = do
bin_dict_map = dict_map_ref }
-- put the main thing
- bh <- return $ setUserData bh0 $ newWriteState (putName bin_symtab)
- (putFastString bin_dict)
+ let bh = setUserData bh0 $ newWriteState (putName bin_symtab)
+ (putFastString bin_dict)
put_ bh iface
-- write the symtab pointer at the front of the file
@@ -295,12 +296,9 @@ putSymbolTable bh next_off symtab = do
getSymbolTable :: BinHandle -> NameCache -> IO (NameCache, Array Int Name)
getSymbolTable bh namecache = do
sz <- get bh
- od_names <- sequence (replicate sz (get bh))
- let
- arr = listArray (0,sz-1) names
- (namecache', names) =
- mapAccumR (fromOnDiskName arr) namecache od_names
- --
+ od_names <- replicateM sz (get bh)
+ let arr = listArray (0,sz-1) names
+ (namecache', names) = mapAccumR (fromOnDiskName arr) namecache od_names
return (namecache', arr)