summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Ext
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-10-10 21:15:36 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-01 01:11:09 -0400
commitdfd27445308d1ed2df8826c2a045130e918e8192 (patch)
tree99fc01edeebc2924ddb7533864e0d4ca18cfe800 /compiler/GHC/Iface/Ext
parentbd4abdc953427e084e7ecba89db64860f6859822 (diff)
downloadhaskell-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.hs7
-rw-r--r--compiler/GHC/Iface/Ext/Fields.hs2
-rw-r--r--compiler/GHC/Iface/Ext/Utils.hs5
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