diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-01-05 16:57:01 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-01-06 14:24:59 +0000 |
commit | 39337a6d97c853a88fa61d6b12a04eb8c2e5984f (patch) | |
tree | 0dd7051080041ee928429832122b9dd14add302c /compiler/main/GhcMonad.hs | |
parent | 32973bf3c2f6fe00e01b44a63ac1904080466938 (diff) | |
download | haskell-39337a6d97c853a88fa61d6b12a04eb8c2e5984f.tar.gz |
Remove redundant constraints in the compiler itself, found by -fwarn-redundant-constraints
Diffstat (limited to 'compiler/main/GhcMonad.hs')
-rw-r--r-- | compiler/main/GhcMonad.hs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/compiler/main/GhcMonad.hs b/compiler/main/GhcMonad.hs index ebcaf368e1..6a3e107801 100644 --- a/compiler/main/GhcMonad.hs +++ b/compiler/main/GhcMonad.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE CPP, RankNTypes #-} {-# OPTIONS_GHC -funbox-strict-fields #-} -- ----------------------------------------------------------------------------- -- @@ -156,7 +156,8 @@ reifyGhc act = Ghc $ act -- -- Note that the wrapped monad must support IO and handling of exceptions. newtype GhcT m a = GhcT { unGhcT :: Session -> m a } -liftGhcT :: Monad m => m a -> GhcT m a + +liftGhcT :: m a -> GhcT m a liftGhcT m = GhcT $ \_ -> m instance Functor m => Functor (GhcT m) where @@ -183,10 +184,18 @@ instance ExceptionMonad m => ExceptionMonad (GhcT m) where in unGhcT (f g_restore) s -instance (Functor m, ExceptionMonad m, MonadIO m) => HasDynFlags (GhcT m) where +#if __GLASGOW_HASKELL__ < 710 +instance (ExceptionMonad m, Functor m) => HasDynFlags (GhcT m) where +#else +instance (ExceptionMonad m) => HasDynFlags (GhcT m) where +#endif getDynFlags = getSessionDynFlags -instance (Functor m, ExceptionMonad m, MonadIO m) => GhcMonad (GhcT m) where +#if __GLASGOW_HASKELL__ < 710 +instance (ExceptionMonad m, Functor m) => GhcMonad (GhcT m) where +#else +instance (ExceptionMonad m) => GhcMonad (GhcT m) where +#endif getSession = GhcT $ \(Session r) -> liftIO $ readIORef r setSession s' = GhcT $ \(Session r) -> liftIO $ writeIORef r s' |