Skip to content

Commit 165ffa4

Browse files
committed
ghcide: Core.Compile: getDocsBatch: use Map
Turn `[]` into idiomatic Map.
1 parent 6a0907e commit 165ffa4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -996,17 +996,17 @@ getDocsBatch
996996
-> [Name]
997997
-> IO (Map.Map Name (Either String (Maybe HsDocString, Map.Map Int HsDocString)))
998998
getDocsBatch hsc_env _mod _names = do
999-
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ traverse findNameInfo _names
999+
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map.fromList <$> traverse findNameInfo _names
10001000
case res of
1001-
Just x -> return $ Map.fromList $ fun x
1001+
Just x -> return $ fun x
10021002
Nothing -> throwErrors errs
10031003
where
1004-
fun :: [(Name, Either GetDocsFailure c)] -> [(Name, Either String c)]
1004+
fun :: Map.Map Name (Either GetDocsFailure c) -> Map.Map Name (Either String c)
10051005
fun =
1006-
map fun1
1006+
Map.map fun1
10071007
where
1008-
fun1 :: ((Name, Either GetDocsFailure c) -> (Name, Either String c))
1009-
fun1 = fmap (first $ T.unpack . showGhc)
1008+
fun1 :: Either GetDocsFailure c -> Either String c
1009+
fun1 = first $ T.unpack . showGhc
10101010

10111011
throwErrors = liftIO . throwIO . mkSrcErr
10121012

0 commit comments

Comments
 (0)