Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support base > 3

  • Loading branch information...
commit 15d28143d9abd480cde3a4b549702da796cc938f 1 parent 84f45ce
@basvandijk basvandijk authored
Showing with 19 additions and 6 deletions.
  1. +18 −5 src/Control/Monad/Base.hs
  2. +1 −1  transformers-base.cabal
View
23 src/Control/Monad/Base.hs
@@ -13,8 +13,6 @@ module Control.Monad.Base (
import Data.Monoid
import Data.Functor.Identity
import Control.Applicative (Applicative)
-import qualified Control.Monad.ST.Lazy as L
-import qualified Control.Monad.ST.Strict as S
import Control.Monad.Trans.Class
import Control.Monad.Trans.Identity
import Control.Monad.Trans.Maybe
@@ -28,7 +26,15 @@ import qualified Control.Monad.Trans.RWS.Lazy as L
import qualified Control.Monad.Trans.RWS.Strict as S
import Control.Monad.Trans.Error
import Control.Monad.Trans.Cont
+
+#if MIN_VERSION_base(4,4,0)
+import qualified Control.Monad.ST.Lazy as L
+import qualified Control.Monad.ST.Strict as S
+#endif
+
+#if MIN_VERSION_base(4,3,0)
import GHC.Conc.Sync (STM)
+#endif
class (Applicative b, Applicative m, Monad b, Monad m)
MonadBase b m | mb where
@@ -39,14 +45,21 @@ class (Applicative b, Applicative m, Monad b, Monad m)
instance MonadBase (M) (M) where liftBase = id
BASE(IO)
-BASE(L.ST s)
-BASE(S.ST s)
-BASE(STM)
BASE(Maybe)
BASE(Either e)
BASE([])
BASE((→) r)
BASE(Identity)
+
+#if MIN_VERSION_base(4,3,0)
+BASE(STM)
+#endif
+
+#if MIN_VERSION_base(4,4,0)
+BASE(L.ST s)
+BASE(S.ST s)
+#endif
+
#undef BASE
-- | Can be used as a default implementation for 'liftBase'.
View
2  transformers-base.cabal
@@ -29,7 +29,7 @@ Source-Repository head
Library
Build-Depends:
- base >= 4.4 && < 5,
+ base >= 3 && < 5,
transformers >= 0.2
Hs-Source-Dirs: src
GHC-Options: -Wall
Please sign in to comment.
Something went wrong with that request. Please try again.