Commit Graph

247 Commits

Author SHA1 Message Date
Daniel Gröber
e5c6d3e472 Start migrating Ghc -> GhcMod monad 2014-05-14 17:06:29 +02:00
Kohei Suzuki
ef375668d1 Suppress empty line 2014-05-11 00:30:02 +09:00
Daniel Gröber
96a85fe953 Copy readMaybe/readEither from base >= 4.7 for backwards compatibility 2014-05-10 13:43:46 +02:00
Daniel Gröber
5492f0c5d1 Add license headers for code copied from Cabal 2014-05-10 13:43:27 +02:00
Daniel Gröber
f949e4be7a Copy ComponentLocalBuildInfo from Cabal-1.18
This way `configDependencies` works even when the Cabal version used by
cabal-install is later than the one used by ghc-mod.
2014-05-10 02:04:09 +02:00
Daniel Gröber
13930a9d7d Fix Cabal >= 1.18 2014-05-09 21:12:52 +02:00
Daniel Gröber
175635505d Fix warnings 2014-05-09 20:44:33 +02:00
Daniel Gröber
8741323f5b Fix tests for Cabal <= 1.16 2014-05-09 20:37:15 +02:00
Daniel Gröber
d1da6ab289 Make getSystemLibDir use GHC.Paths instead of running ghc 2014-05-09 20:36:20 +02:00
Daniel Gröber
b8f9498f83 Fix reading of older Cabal setup-configs 2014-05-09 20:35:13 +02:00
Kazu Yamamoto
2e3b172b0e enabling -fno-warn- (#246). 2014-05-09 23:45:34 +09:00
Daniel Gröber
fae4730ba5 Import HscTypes (HscEnv) with ghc <= 7.2 2014-05-08 13:14:44 +02:00
Daniel Gröber
a7b2c86985 Fall back to Cabal 1.16 format on runtime if extracting fails 2014-05-08 12:59:52 +02:00
Daniel Gröber
4c93819da8 Fix ghc-7.8 2014-05-08 11:50:51 +02:00
Daniel Gröber
7b8540add1 Add support for getting pkgDeps with Cabal <= 1.16 2014-05-08 11:32:40 +02:00
Kazu Yamamoto
b7d92417bc HasDynFlags is provided after 7.6. 2014-05-08 17:01:01 +09:00
Kazu Yamamoto
cc3e728f03 fixing comment. 2014-05-08 16:51:15 +09:00
Daniel Gröber
61207c13d3 Add MonadIO instance for RWST 2014-05-08 08:36:18 +02:00
Kazu Yamamoto
8561e7b656 To break cyclic import, this patch makes GhcPkg.hs independent from Monad.hs(refactoring for #244)
This removes `ghcPkgList`, `ghcPkgListEx` and `ghcPkgDbOpt`. I'm not sure
this is a right way to do.
2014-05-08 12:42:45 +09:00
Kazu Yamamoto
f199ea9e2e removing warnings. 2014-05-08 10:49:40 +09:00
Daniel Gröber
5044cf7f56 Fix warnings 2014-05-05 09:43:14 +02:00
Daniel Gröber
635830b527 Fix #242, ghcPkgList(Ex) on NixOS 2014-05-05 00:29:10 +02:00
Daniel Gröber
ea427d60ba note: MonadIO class 2014-05-04 04:57:38 +02:00
Daniel Gröber
c50b4f5a38 ghc-mod deserves it's own monad
Having to call `findCradle` and `initializeFlagsWithCradle` everywhere
we interact with ghc-mod's API doesn't seem very Haskell-like to me I
think we should provide a Monad that has a run function that already
does all those tedious tasks for us.

The `GhcMod` monad is basically a wrapper around `RWST r w s IO` with an
instance for `GhcMonad`

Having a `Reader` allows us to pass `Options` to runGhcMod and not have
to worry about passing it everywhere, `Cradle` is also stored in the
reader environment on initialization.

Writer and State are just there for future use.

I've included a `toGhcMod` function that turns a `Ghc a` into a `GhcMod
a` this will make it easy to transition everyting to using the `GhcMod`
monad instead of `Ghc` without breaking the build or test suite for
extended periods of time.

Conflicts:
	ghc-mod.cabal
2014-05-04 04:57:38 +02:00
Daniel Gröber
096a56e660 Hide catch from Prelude 2014-05-04 04:57:38 +02:00
Daniel Gröber
4e4d27e62d Use componentsConfigs instead of configDependencies
`configDependencies` was added in Cabal-1.20 but we're using 1.18 on travis.
2014-05-04 04:57:38 +02:00
Daniel Gröber
9d9f66e942 Remove Maybe from cabalConfigDependencies and fromInstalledPackageId 2014-05-04 04:57:38 +02:00
Daniel Gröber
0c859294a3 Parse cabal setup-config to get depencencies 2014-05-03 15:36:10 +02:00
Daniel Gröber
19b56738c6 Add withDirectory_ to Utils 2014-05-03 15:36:10 +02:00
Daniel Gröber
aec46dbd51 Factor out readProcess' 2014-05-03 15:36:10 +02:00
Daniel Gröber
77605c6daf Add fromInstalledPackageId 2014-05-03 15:36:10 +02:00
Kazu Yamamoto
14f5768c90 doc. 2014-04-30 10:51:34 +09:00
Kazu Yamamoto
186485577d bootInfo as API. 2014-04-30 10:49:25 +09:00
Kazu Yamamoto
d007fa817a better names. 2014-04-28 21:59:54 +09:00
Kazu Yamamoto
a1aa44bdbb doc. 2014-04-28 21:51:39 +09:00
Kazu Yamamoto
913fb72911 ErrMsg -> Logger. 2014-04-28 21:47:08 +09:00
Kazu Yamamoto
0155cf5e5f style. 2014-04-28 21:43:24 +09:00
Kazu Yamamoto
d68690bab0 removing LogReader. 2014-04-28 21:41:29 +09:00
Kazu Yamamoto
411a584bb8 using check finally. 2014-04-28 16:31:28 +09:00
Kazu Yamamoto
9bc25046e3 rescue old GHCs. 2014-04-28 14:36:55 +09:00
Kazu Yamamoto
ae75872638 fixing regression. 2014-04-28 14:36:46 +09:00
Kazu Yamamoto
662842a085 clean up Gap. 2014-04-28 14:13:25 +09:00
Kazu Yamamoto
adb4addd54 707 -> 708. 2014-04-28 14:04:18 +09:00
Kazu Yamamoto
fc570551a2 withLogger handles errors. 2014-04-28 13:52:28 +09:00
Kazu Yamamoto
000076223f removing the third argument from initializeFlagsWithCradle. 2014-04-28 13:00:25 +09:00
Kazu Yamamoto
117d01a52a removing -Wall and -w:. 2014-04-28 12:52:09 +09:00
Kazu Yamamoto
f413cda0fe one more try. 2014-04-28 11:26:06 +09:00
Kazu Yamamoto
6a7955679a rescue old GHCs. 2014-04-28 09:28:57 +09:00
Kazu Yamamoto
2733f94a52 rescue old GHCs. 2014-04-28 09:00:03 +09:00
Kazu Yamamoto
017d4cc22f don't use InteractiveImport for old GHCs.. 2014-04-27 22:48:24 +09:00