Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeOf triggers deprecation warnings #91

Open
gelisam opened this issue Feb 17, 2020 · 0 comments
Open

typeOf triggers deprecation warnings #91

gelisam opened this issue Feb 17, 2020 · 0 comments
Labels

Comments

@gelisam
Copy link
Contributor

gelisam commented Feb 17, 2020

If the user can't use these identifiers nor obtain their types, maybe we shouldn't list them in getModuleExports?

-- |
-- >>> :{
-- do contents <- browse "Data.Map"
--    for_ contents $ \(identifier, tp) -> do
--      putStrLn $ identifier ++ " :: " ++ tp
-- :}
-- *** Exception: WontCompile [GhcError {errMsg = "<interactive>:1:1: error: Data.Map.fold is gone. Use foldr."}]
browse :: Hint.ModuleName -> IO [(String, String)]
browse moduleName = runInterpreter $ do
  Hint.setImports ["Prelude", "Data.Typeable", moduleName]
  exports <- Hint.getModuleExports moduleName
  execWriterT $ do
    for_ exports $ \case
      Hint.Fun identifier -> do
        tp <- lift $ Hint.typeOf identifier
        tell [(identifier, tp)]
      _ -> pure ()  -- skip datatypes and typeclasses
@gelisam gelisam added the bug label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant