Skip to content

Commit a5ae696

Browse files
committed
ghcide: Core.Compile: getDocsBatch: use idiomatic Map.mapWithKey
1 parent ce1c960 commit a5ae696

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ghcide/src/Development/IDE/Spans/Documentation.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ getDocumentationsTryGhc env mod names = do
7272
res <- fun
7373
case res of
7474
Left _ -> return mempty -- catchSrcErrors (hsc_dflags env) "docs"
75-
Right res -> fmap Map.fromList $ sequenceA $ uncurry unwrap <$> Map.toList res
75+
Right res -> sequenceA $ Map.mapWithKey unwrap res
7676
where
7777
fun :: IO (Either ErrorMessages (Map.Map Name (Either T.Text (Maybe HsDocString, Maybe (Map.Map Int HsDocString)))))
7878
fun = getDocsBatch env mod names
7979

80-
unwrap :: Name -> Either a (Maybe HsDocString, b) -> IO (Name, SpanDoc)
81-
unwrap name a = (name,) . extractDocString a <$> getSpanDocUris name
80+
unwrap :: Name -> Either a (Maybe HsDocString, b) -> IO SpanDoc
81+
unwrap name a = extractDocString a <$> getSpanDocUris name
8282
where
8383
extractDocString :: Either b1 (Maybe HsDocString, b2) -> SpanDocUris -> SpanDoc
8484
-- 2021-11-17: FIXME: ArgDocs get dropped here - instead propagate them.

0 commit comments

Comments
 (0)