From a8f9b354a7304ce5ad9c7e51105b35717ffac93f Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Thu, 21 Apr 2016 11:05:08 +1000 Subject: [PATCH] CPP around differences in 7.8 vs 7.10 --- bench/Core.hs | 9 ++++++++- src/Control/Monad/Freer/Writer.hs | 6 +++++- tests/Tests.hs | 5 +++++ tests/Tests/Coroutine.hs | 7 ++++++- tests/Tests/Exception.hs | 2 ++ tests/Tests/Reader.hs | 6 ++++++ 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/bench/Core.hs b/bench/Core.hs index 73cbcf6..71c3c19 100644 --- a/bench/Core.hs +++ b/bench/Core.hs @@ -5,8 +5,16 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE CPP #-} module Main where +#if __GLASGOW_HASKELL__ <= 708 +import Control.Applicative +import qualified Control.Monad.Error as MTL +#else +import qualified Control.Monad.Except as MTL +#endif + import Control.Monad import Control.Monad.Freer import Control.Monad.Freer.Internal @@ -17,7 +25,6 @@ import Control.Monad.Freer.StateRW import Criterion import Criterion.Main import qualified Control.Monad.State as MTL -import qualified Control.Monad.Except as MTL import qualified Control.Monad.Free as Free -------------------------------------------------------------------------------- diff --git a/src/Control/Monad/Freer/Writer.hs b/src/Control/Monad/Freer/Writer.hs index c752ab6..0c3853f 100644 --- a/src/Control/Monad/Freer/Writer.hs +++ b/src/Control/Monad/Freer/Writer.hs @@ -2,7 +2,7 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} - +{-# LANGUAGE CPP #-} {-| Module : Control.Monad.Freer.Writer Description : Composable Writer effects - @@ -24,6 +24,10 @@ module Control.Monad.Freer.Writer ( runWriter ) where +#if __GLASGOW_HASKELL__ <= 708 +import Data.Monoid +#endif + import Control.Monad.Freer.Internal -- | Writer effects - send outputs to an effect environment diff --git a/tests/Tests.hs b/tests/Tests.hs index 778ab31..128147d 100644 --- a/tests/Tests.hs +++ b/tests/Tests.hs @@ -1,5 +1,10 @@ +{-# LANGUAGE CPP #-} module Main where +#if __GLASGOW_HASKELL__ <= 708 +import Control.Applicative +#endif + import Control.Monad.Freer import Test.Tasty diff --git a/tests/Tests/Coroutine.hs b/tests/Tests/Coroutine.hs index 1057b8c..72e1089 100644 --- a/tests/Tests/Coroutine.hs +++ b/tests/Tests/Coroutine.hs @@ -1,10 +1,15 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} - +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} module Tests.Coroutine ( runTestCoroutine ) where +#if __GLASGOW_HASKELL__ <= 708 +import Control.Applicative +#endif + import Control.Monad import Control.Monad.Freer import Control.Monad.Freer.Coroutine diff --git a/tests/Tests/Exception.hs b/tests/Tests/Exception.hs index a49cffa..ed43b4d 100644 --- a/tests/Tests/Exception.hs +++ b/tests/Tests/Exception.hs @@ -1,6 +1,8 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ConstraintKinds #-} + module Tests.Exception ( TooBig(..), diff --git a/tests/Tests/Reader.hs b/tests/Tests/Reader.hs index 07673c7..74525df 100644 --- a/tests/Tests/Reader.hs +++ b/tests/Tests/Reader.hs @@ -1,10 +1,16 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} module Tests.Reader ( testReader, testMultiReader, testLocal ) where +#if __GLASGOW_HASKELL__ <= 708 +import Control.Applicative +#endif + import Control.Monad.Freer import Control.Monad.Freer.Reader