Commit Graph

1910 Commits

Author SHA1 Message Date
Daniel Gröber
3b5b9f8fcf Expose Language.Haskell.GhcMod.Monad 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
f750d10a9a Cabal needs empty 00-index.cache and 00-index.tar in sanxbox 2014-05-03 15:38:27 +02:00
Daniel Gröber
96a54d2148 Remove test/*/setup-config before spec 2014-05-03 15:38:27 +02:00
Daniel Gröber
7b98cb0e85 Add cabal to PATH in travis script 2014-05-03 15:36:10 +02:00
Daniel Gröber
2839d6b557 Add UtilsSpec 2014-05-03 15:36:10 +02:00
Daniel Gröber
92d0eec2bc Fix failing test 2014-05-03 15:36:10 +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
Daniel Gröber
6ad386d31e Add test data to Extra-Source-Files 2014-05-03 15:35:04 +02:00
Daniel Gröber
82d1d6b982 Add cabal file to duplicate-pkgver test data
It's not really valid but enough to make ghc-mod happy, without it
findCradle doesn't work properly and without the empty `library`
sections it crashes even.
2014-05-03 15:35:04 +02:00
Daniel Gröber
158c0bba16 Add package.cache to .gitignore and make .cabal-sandbox absolute 2014-05-03 15:35:04 +02:00
Daniel Gröber
759a6efab1 Add some test data
..for testing behaviour with multiple versions/ids of packges being
available
2014-05-03 15:35:04 +02:00
Daniel Gröber
ee0135aac2 Correct check-packageid/cabal.sandbox.config.in 2014-05-03 15:35:04 +02:00
Daniel Gröber
0206085662 Generate ghc package.cache before running spec 2014-05-03 15:35:04 +02:00
Kazu Yamamoto
130ec43ad5 Merge pull request #238 from DanielG/dev-hspec
Bump hspec dependency, should fix #236
2014-05-01 09:50:45 +09:00
Daniel Gröber
1c27e9ec4e Bump hspec dependency, should fix #236
`hspec-discover --no-main` was introduced in 1.8.2
2014-05-01 01:31:32 +02:00
Bryan O'Sullivan
0650cbd359 Check Emacs version at start
I ran into this when I tried to use ghc-mod with Emacs 24.2, and
got a mysterious error telling me that defvar-local was not defined.
2014-04-30 16:19:23 -07:00
Kazu Yamamoto
9c63d53dd5 changelog. 2014-04-30 21:45:39 +09:00
Kazu Yamamoto
506d8f1baa hcar. 2014-04-30 12:40:41 +09: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
bb8df8cbdf bootInfo uses boot. 2014-04-30 10:39:39 +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
0d494f3c8e (discard-input) avoids getting stuck. 2014-04-28 21:27:27 +09:00
Kazu Yamamoto
411a584bb8 using check finally. 2014-04-28 16:31:28 +09:00
Kazu Yamamoto
bb38a930e7 removing imports. 2014-04-28 14:45:43 +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
ca6ca23aa7 doc. 2014-04-28 09:29:24 +09:00
Kazu Yamamoto
6a7955679a rescue old GHCs. 2014-04-28 09:28:57 +09:00
Kazu Yamamoto
248a999f99 t of (sit-for 0.1 t) has a bug, so do not use it. 2014-04-28 09:13:14 +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
Kazu Yamamoto
4d2ef23f33 passing 'ok/'ng to callback. 2014-04-27 21:51:44 +09:00
Kazu Yamamoto
dede115731 defining withContext. 2014-04-27 21:26:03 +09:00
Kazu Yamamoto
64365807f9 refactoring. 2014-04-26 23:03:50 +09:00