Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 1805ebb

Browse files
committed
Remove unused function and add comment
1 parent 11bbe7f commit 1805ebb

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

hie-plugin-api/Haskell/Ide/Engine/TypeMap.hs

+6-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import qualified Data.IntervalMap.FingerTree as IM
1010

1111
import qualified GHC
1212
import GHC ( TypecheckedModule )
13-
import GhcMod.SrcUtils
1413

1514
import Data.Data as Data
1615
import Control.Monad.IO.Class
@@ -31,9 +30,11 @@ genTypeMap tm = do
3130
hs_env <- GHC.getSession
3231
liftIO $ types hs_env typecheckedSource
3332

34-
collectAllSpansTypes'
35-
:: GHC.GhcMonad m => Bool -> TypecheckedModule -> m [(GHC.SrcSpan, GHC.Type)]
36-
collectAllSpansTypes' = collectAllSpansTypes
33+
34+
everythingInTypecheckedSourceM
35+
:: Data x => (forall a . Data a => a -> IO TypeMap) -> x -> IO TypeMap
36+
everythingInTypecheckedSourceM = everythingButTypeM @GHC.Id
37+
3738

3839
-- | Obtain details map for types.
3940
types :: GHC.HscEnv -> GHC.TypecheckedSource -> IO TypeMap
@@ -53,11 +54,6 @@ types hs_env = everythingInTypecheckedSourceM (ty `combineM` fun)
5354
return (IM.singleton (rspToInt spn) (TcHsSyn.hsPatType hsPatType))
5455
_ -> return IM.empty
5556

56-
57-
everythingInTypecheckedSourceM
58-
:: Data x => (forall a . Data a => a -> IO TypeMap) -> x -> IO TypeMap
59-
everythingInTypecheckedSourceM f = everythingButTypeM @GHC.Id f
60-
6157
-- | Combine two queries into one using alternative combinator.
6258
combineM
6359
:: (forall a . Data a => a -> IO TypeMap)
@@ -115,7 +111,7 @@ everythingButM f x = do
115111
-- Since the above is quite costly, we just skip cases where computing the
116112
-- expression's type is going to be expensive.
117113
--
118-
-- See #16233
114+
-- See #16233<https://gitlab.haskell.org/ghc/ghc/issues/16233>
119115
getType
120116
:: GHC.HscEnv -> GHC.LHsExpr GHC.GhcTc -> IO (Maybe (GHC.SrcSpan, Type.Type))
121117
getType hs_env e@(GHC.L spn e') =

0 commit comments

Comments
 (0)