Commit Graph

28 Commits

Author SHA1 Message Date
Kazu Yamamoto
cf0df26560 Monad.hs is now exported by GhcMod.hs. 2014-07-17 14:30:42 +09:00
Kazu Yamamoto
49284a64be Uses HscNothing and falls back to HscInterpreted if necessary (#205)
Two Test case are fails but it is not fatal.
2014-07-15 17:20:35 +09:00
Kazu Yamamoto
c87ea45488 adding #if to Monad.hs. 2014-07-15 14:45:41 +09:00
Kazu Yamamoto
a7a02a3f4c Bringing back MaybeT
This brings back a warning to be fixed.
2014-07-15 12:49:12 +09:00
Kazu Yamamoto
1524d2a43e removing warnings. 2014-07-15 12:10:18 +09:00
Daniel Gröber
686179f12b Fix building with ghc < 7.8 2014-07-15 02:34:07 +02:00
Daniel Gröber
7474a1b652 Bring back GhcMod but this time it's a GhcModT with an ErrorT inside 2014-07-15 01:04:06 +02:00
Daniel Gröber
f0bfcb8811 Use GhcModT everywhere and remove the GhcMod alias
Not doing this makes having GhcModT pretty pointless as users of the
library wouldn't be able to use custom inner monads as evey function for
dealing with GhcModT's would be constraint to (GhcModT IO) thus only
allowing IO as the inner monad.
2014-07-15 01:03:56 +02:00
Daniel Gröber
b6896a481a Move initializeFlagsWithCradle to Monad.hs 2014-07-12 03:33:04 +02:00
Daniel Gröber
d818a64f6f whitespace 2014-07-11 04:51:27 +02:00
Daniel Gröber
320b2243a2 Make GhcMod a special case of GhcModT
i.e. turn GhcMod into a monad transformer
2014-07-11 04:51:11 +02:00
Daniel Gröber
4b6a687bc1 Migrate the remaining parts of the exposed API to GhcMod a 2014-07-11 03:13:38 +02:00
Daniel Gröber
dc5ba6d00d Add newGhcModEnv for allowing multiple active sessions
Conflicts:
	Language/Haskell/GhcMod/Monad.hs
2014-07-10 21:14:47 +02:00
Daniel Gröber
86a7f954e3 Add a comment discouraging the use of toGhcMod in new code 2014-07-04 19:03:02 +02:00
Kazu Yamamoto
f2e20e3279 comments. 2014-07-03 14:26:39 +09:00
Kazu Yamamoto
640140608e layout. 2014-07-03 14:22:43 +09:00
Kazu Yamamoto
826d42f824 clean up macros. 2014-07-03 14:19:36 +09:00
Kazu Yamamoto
c13fdde2f8 importing Control.Monad.IO.Class explicity.
trying to resolve #277.
2014-07-03 12:50:46 +09:00
Kazu Yamamoto
fcc3b46415 defining C macro if not defined. 2014-05-16 09:27:23 +09:00
Daniel Gröber
f1535efcf2 Ghc -> GhcMod: Browse, Check 2014-05-14 17:06:29 +02:00
Daniel Gröber
e5c6d3e472 Start migrating Ghc -> GhcMod monad 2014-05-14 17:06:29 +02:00
Daniel Gröber
175635505d Fix warnings 2014-05-09 20:44:33 +02:00
Daniel Gröber
fae4730ba5 Import HscTypes (HscEnv) with ghc <= 7.2 2014-05-08 13:14:44 +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
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