Remove type Db
it's only used once and makes things less clear
This commit is contained in:
parent
15e288decf
commit
4f0f5f09a6
@ -46,9 +46,8 @@ import qualified Data.Map as M
|
|||||||
|
|
||||||
-- | Type of function and operation names.
|
-- | Type of function and operation names.
|
||||||
type Symbol = String
|
type Symbol = String
|
||||||
type Db = Map Symbol [ModuleString]
|
|
||||||
-- | Database from 'Symbol' to \['ModuleString'\].
|
-- | Database from 'Symbol' to \['ModuleString'\].
|
||||||
newtype SymbolDb = SymbolDb Db
|
newtype SymbolDb = SymbolDb (Map Symbol [ModuleString])
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
@ -81,7 +80,7 @@ lookupSymbol opt sym db = convert opt $ lookupSymbol' sym db
|
|||||||
loadSymbolDb :: IO SymbolDb
|
loadSymbolDb :: IO SymbolDb
|
||||||
loadSymbolDb = SymbolDb <$> readSymbolDb
|
loadSymbolDb = SymbolDb <$> readSymbolDb
|
||||||
|
|
||||||
readSymbolDb :: IO Db
|
readSymbolDb :: IO (Map Symbol [ModuleString])
|
||||||
readSymbolDb = handle (\(SomeException _) -> return M.empty) $ do
|
readSymbolDb = handle (\(SomeException _) -> return M.empty) $ do
|
||||||
file <- chop <$> readProcess "ghc-mod" ["dumpsym"] []
|
file <- chop <$> readProcess "ghc-mod" ["dumpsym"] []
|
||||||
M.fromAscList . map conv . lines <$> readFile file
|
M.fromAscList . map conv . lines <$> readFile file
|
||||||
|
Loading…
Reference in New Issue
Block a user