Skip to content
This repository was archived by the owner on Apr 25, 2020. It is now read-only.
Closed
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2485221
Merging the ghc-imported-from utility.
carlohamalainen Jul 12, 2016
5126454
Dependencies for imported-from command.
carlohamalainen Jul 12, 2016
4e4f69c
Add imported-from command.
carlohamalainen Jul 12, 2016
bd62eb0
Fix a type error.
carlohamalainen Jul 12, 2016
5d26b71
Remove bound on process-streaming.
carlohamalainen Jul 12, 2016
6339f63
Fix bounds for haddock-api with ghc 7.x and 8.x
carlohamalainen Jul 12, 2016
875b513
Revert ghc-mod.cabal to current master.
carlohamalainen Jul 15, 2016
ae39594
Import in alphabetical position.
carlohamalainen Jul 15, 2016
47becac
LANGUAGE extensions on one line.
carlohamalainen Jul 15, 2016
ffc755b
Remove unused import.
carlohamalainen Jul 15, 2016
cfb9693
Revert to current master.
carlohamalainen Jul 15, 2016
07e4be3
Remove dependency on System.Process.Streaming
carlohamalainen Jul 15, 2016
af4e620
Use gmReadProcess. Builds and tests pass with ghc-7.10.3
carlohamalainen Jul 15, 2016
1736e24
Fix import for Control.Applicative
carlohamalainen Jul 16, 2016
d9c9477
Avoid use of "traverse" which is not in ghc-7.6.3
carlohamalainen Jul 16, 2016
7b8d5a7
Builds on ghc-7.6.3; added some fallback cases for earlier versions o…
carlohamalainen Jul 16, 2016
7fa7b12
Move #if things to Language.Haskell.GhcMod.Gap.
carlohamalainen Jul 16, 2016
1557ef1
Add type sig.
carlohamalainen Jul 16, 2016
d276260
Remove definition of tdflags (also gets rid of unsafeGlobalDynFlags).
carlohamalainen Jul 17, 2016
7106525
Remove constraints on GmOut and GmLog.
carlohamalainen Jul 17, 2016
048eaac
Fewer imports; move moduleNameToHtmlFile into a where clause.
carlohamalainen Jul 17, 2016
13e5cda
Move filterMatchingQualifiedImport to a where clause; tidy up
carlohamalainen Jul 17, 2016
f52077c
Use parameter of ```gmLog GmDebug``` instead of passing ```""```.
carlohamalainen Jul 17, 2016
50a52d2
Reformat some very long lines.
carlohamalainen Jul 17, 2016
1339dc5
Merge changes from master.
carlohamalainen Jul 17, 2016
ec38b27
Merging changes from master.
carlohamalainen Jul 17, 2016
84579ef
Tweaks for building on earlier versions of ghc.
carlohamalainen Jul 17, 2016
b94f2f4
Adjust ghc version bound on ghcIdeclHiding.
carlohamalainen Jul 17, 2016
6b11e9d
Tweaks for building on GHC8.
carlohamalainen Jul 19, 2016
ae4badb
Use exit code instead of printing SUCCESS / FAIL.
carlohamalainen Jul 19, 2016
fb1c146
Add ImportedFromSpec to test suite.
carlohamalainen Jul 19, 2016
fa1417a
Use top-level error GMEMissingHaddock when missing haddock html.
carlohamalainen Jul 19, 2016
40e3daf
Use GMError type instead of calling plain "error".
carlohamalainen Jul 19, 2016
b1c1b2a
Tidying up logging.
carlohamalainen Jul 20, 2016
9eb0cc8
Add note about setting documentation:True in .cabal/config.
carlohamalainen Jul 24, 2016
6f83fab
Tweak for resolver on internal symbols (tested with GHC8; added testc…
carlohamalainen Jul 24, 2016
2edda72
Forgot "$$".
carlohamalainen Jul 24, 2016
704cff6
Drop parens in qualified name. New in GHC8?
carlohamalainen Jul 24, 2016
cdbe0ef
Adding some more test cases.
carlohamalainen Jul 29, 2016
e2f6092
Remove dependency on parsec.
carlohamalainen Jul 30, 2016
f6ba25b
Tidyup some warnings.
carlohamalainen Jul 30, 2016
0961feb
Accidentally removed import of Control.Applicative.
carlohamalainen Jul 30, 2016
ea1d4a0
Instead of throwing an exception if the haddock file is missing,
carlohamalainen Aug 8, 2016
c37907c
Improved tests for imported-from command. Actually checks the output
carlohamalainen Aug 8, 2016
e413cea
Merge remote-tracking branch 'remotes/upstream/master' into ghc-impor…
carlohamalainen Aug 8, 2016
5eefa23
Don't use Python-style leading underscore.
carlohamalainen Aug 9, 2016
122cfd5
Remove dead code.
carlohamalainen Aug 9, 2016
f3c9268
Use things from Control.Monad.Trans.Maybe.
carlohamalainen Aug 9, 2016
fc02ddc
Remove unused dependency.
carlohamalainen Aug 9, 2016
a9fa573
Remove stackoverflow snippet.
carlohamalainen Aug 9, 2016
4897f16
Remove another ```fromMaybe (throw ...)``` pattern.
carlohamalainen Aug 9, 2016
2be2742
fail instead of throw; tidy up some definitions.
carlohamalainen Aug 9, 2016
8d4d2c7
Use a view pattern.
carlohamalainen Aug 9, 2016
21a81b2
Tidying up.
carlohamalainen Aug 9, 2016
e36a3c3
Flag for cabal install is --only-dependencies not --dependencies-only.
carlohamalainen Aug 9, 2016
83f27c6
Avoid use of ```nub```.
carlohamalainen Aug 9, 2016
c995e15
Note on use of ```last```.
carlohamalainen Aug 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Language/Haskell/GhcMod/ImportedFrom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ ghcPkgFindModule mod = do

shortcut [ stackGhcPkgFindModule rp mod
, hcPkgFindModule rp mod
, _ghcPkgFindModule rp mod
, ghcPkgFindModule' rp mod

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI in GHC a leading underscore denotes a typed hole but you can also use it to suppress the "unused symbol" warning when you then go on to define that symbol. I'm not aware of what "python style" you refer to here.

]
where
shortcut :: [m (Maybe a)] -> m (Maybe a)
Expand All @@ -306,15 +306,15 @@ ghcPkgFindModule mod = do

-- | Call @ghc-pkg find-module@ to determine that package that provides a module, e.g. @Prelude@ is defined
-- in @base-4.6.0.1@.
-- _ghcPkgFindModule :: String -> IO (Maybe String)
_ghcPkgFindModule rp m = do
-- ghcPkgFindModule' :: String -> IO (Maybe String)
ghcPkgFindModule' rp m = do
let opts = ["find-module", m, "--simple-output"] ++ ["--global", "--user"] ++ optsForGhcPkg []

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optsForGhcPkg [] == [], also seems to not be called from anywhere else -> dead code.

gmLog GmDebug "_ghcPkgFindModule" $ strDoc $ "ghc-pkg " ++ show opts
gmLog GmDebug "ghcPkgFindModule'" $ strDoc $ "ghc-pkg " ++ show opts

x <- runCmd rp "ghc-pkg" opts

-- gmLog GmDebug "" $ strDoc $ "_ghcPkgFindModule stdout: " ++ show output
-- gmLog GmDebug "" $ strDoc $ "_ghcPkgFindModule stderr: " ++ show err
-- gmLog GmDebug "" $ strDoc $ "ghcPkgFindModule' stdout: " ++ show output
-- gmLog GmDebug "" $ strDoc $ "ghcPkgFindModule' stderr: " ++ show err
return $ case x of
Just x' -> join $ (Safe.lastMay . words) <$> (Safe.lastMay . lines) x'
Nothing -> Nothing
Expand Down