@@ -31,9 +31,11 @@ genTypeMap tm = do
3131 hs_env <- GHC. getSession
3232 liftIO $ types hs_env typecheckedSource
3333
34- collectAllSpansTypes'
35- :: GHC. GhcMonad m => Bool -> TypecheckedModule -> m [(GHC. SrcSpan , GHC. Type )]
36- collectAllSpansTypes' = collectAllSpansTypes
34+
35+ everythingInTypecheckedSourceM
36+ :: Data x => (forall a . Data a => a -> IO TypeMap ) -> x -> IO TypeMap
37+ everythingInTypecheckedSourceM f = everythingButTypeM @ GHC. Id f
38+
3739
3840-- | Obtain details map for types.
3941types :: GHC. HscEnv -> GHC. TypecheckedSource -> IO TypeMap
@@ -53,11 +55,6 @@ types hs_env = everythingInTypecheckedSourceM (ty `combineM` fun)
5355 return (IM. singleton (rspToInt spn) (TcHsSyn. hsPatType hsPatType))
5456 _ -> return IM. empty
5557
56-
57- everythingInTypecheckedSourceM
58- :: Data x => (forall a . Data a => a -> IO TypeMap ) -> x -> IO TypeMap
59- everythingInTypecheckedSourceM f = everythingButTypeM @ GHC. Id f
60-
6158-- | Combine two queries into one using alternative combinator.
6259combineM
6360 :: (forall a . Data a => a -> IO TypeMap )
@@ -115,7 +112,7 @@ everythingButM f x = do
115112-- Since the above is quite costly, we just skip cases where computing the
116113-- expression's type is going to be expensive.
117114--
118- -- See #16233
115+ -- See #16233<https://gitlab.haskell.org/ghc/ghc/issues/16233>
119116getType
120117 :: GHC. HscEnv -> GHC. LHsExpr GHC. GhcTc -> IO (Maybe (GHC. SrcSpan , Type. Type ))
121118getType hs_env e@ (GHC. L spn e') =
0 commit comments