diff --git a/System/Random/MWC/Monad.hs b/System/Random/MWC/Monad.hs
--- a/System/Random/MWC/Monad.hs
+++ b/System/Random/MWC/Monad.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP              #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE TypeFamilies     #-}
 -- |
@@ -44,6 +45,9 @@
 import Control.Monad.IO.Class    (MonadIO(..))
 import Control.Monad.ST          (ST)
 import Control.Monad.Primitive   (PrimState)
+#if MIN_VERSION_primitive(0,6,0)
+import Control.Monad.Primitive   (PrimBase)
+#endif
 import Control.Monad.Primitive.Class (MonadPrim(..))
 
 import Data.Word               (Word32)
@@ -127,7 +131,15 @@
 -- | Run monad using seed obtained from system's fast source of
 --   pseudo-random numbers ("\/dev\/urandom" on Unix-like
 --   systems). @m@ must be either IO or ST.
-runWithSystemRandom :: (MonadPrim m, BasePrimMonad m ~ m) => Rand m a -> IO a
+runWithSystemRandom
+  :: (
+#if MIN_VERSION_primitive(0,6,0)
+       PrimBase m
+#else
+       MonadPrim m
+#endif
+     , BasePrimMonad m ~ m
+     ) => Rand m a -> IO a
 runWithSystemRandom rnd = do
   MWC.withSystemRandom $ \g -> runRand rnd g
 {-# INLINE runWithSystemRandom #-}
diff --git a/mwc-random-monad.cabal b/mwc-random-monad.cabal
--- a/mwc-random-monad.cabal
+++ b/mwc-random-monad.cabal
@@ -1,5 +1,5 @@
 Name:                mwc-random-monad
-Version:             0.7.3.0
+Version:             0.7.3.1
 License:             BSD3
 License-file:        LICENSE
 Author:              Alexey Khudyakov <alexey.skladnoy@gmail.com>
