diff options
author | Hécate <hecate+gitlab@glitchbra.in> | 2020-10-10 21:15:36 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-01 01:11:09 -0400 |
commit | dfd27445308d1ed2df8826c2a045130e918e8192 (patch) | |
tree | 99fc01edeebc2924ddb7533864e0d4ca18cfe800 /compiler/GHC/Iface/Ext | |
parent | bd4abdc953427e084e7ecba89db64860f6859822 (diff) | |
download | haskell-dfd27445308d1ed2df8826c2a045130e918e8192.tar.gz |
Add the proper HLint rules and remove redundant keywords from compiler
Diffstat (limited to 'compiler/GHC/Iface/Ext')
-rw-r--r-- | compiler/GHC/Iface/Ext/Binary.hs | 7 | ||||
-rw-r--r-- | compiler/GHC/Iface/Ext/Fields.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Iface/Ext/Utils.hs | 5 |
3 files changed, 5 insertions, 9 deletions
diff --git a/compiler/GHC/Iface/Ext/Binary.hs b/compiler/GHC/Iface/Ext/Binary.hs index 84ee0af60b..69aee26586 100644 --- a/compiler/GHC/Iface/Ext/Binary.hs +++ b/compiler/GHC/Iface/Ext/Binary.hs @@ -222,9 +222,7 @@ readHieFileHeader file bh0 = do readHieFileContents :: BinHandle -> NameCacheUpdater -> IO HieFile readHieFileContents bh0 ncu = do - - dict <- get_dictionary bh0 - + dict <- get_dictionary bh0 -- read the symbol table so we are capable of reading the actual data bh1 <- do let bh1 = setUserData bh0 $ newReadState (error "getSymtabName") @@ -236,8 +234,7 @@ readHieFileContents bh0 ncu = do return bh1' -- load the actual data - hiefile <- get bh1 - return hiefile + get bh1 where get_dictionary bin_handle = do dict_p <- get bin_handle diff --git a/compiler/GHC/Iface/Ext/Fields.hs b/compiler/GHC/Iface/Ext/Fields.hs index 1cc1e94012..37322303d8 100644 --- a/compiler/GHC/Iface/Ext/Fields.hs +++ b/compiler/GHC/Iface/Ext/Fields.hs @@ -49,7 +49,7 @@ instance Binary ExtensibleFields where n <- get bh :: IO Int -- Get the names and field pointers: - header_entries <- replicateM n $ do + header_entries <- replicateM n $ (,) <$> get bh <*> get bh -- Seek to and get each field's payload: diff --git a/compiler/GHC/Iface/Ext/Utils.hs b/compiler/GHC/Iface/Ext/Utils.hs index 9245a11f7b..5166ddc6b2 100644 --- a/compiler/GHC/Iface/Ext/Utils.hs +++ b/compiler/GHC/Iface/Ext/Utils.hs @@ -194,9 +194,8 @@ compressTypes compressTypes asts = (a, arr) where (a, (HTS _ m i)) = flip runState initialHTS $ - for asts $ \typ -> do - i <- getTypeIndex typ - return i + for asts $ \typ -> + getTypeIndex typ arr = A.array (0,i-1) (IM.toList m) recoverFullType :: TypeIndex -> A.Array TypeIndex HieTypeFlat -> HieTypeFix |