diff --git a/Data/Binary/Defer.hs b/Data/Binary/Defer.hs
--- a/Data/Binary/Defer.hs
+++ b/Data/Binary/Defer.hs
@@ -25,7 +25,7 @@
 import Control.Exception (catch, SomeException)
 
 import System.IO
-import Foreign(unsafePerformIO)
+import System.IO.Unsafe (unsafePerformIO)
 import Control.Monad
 import Data.Binary.Defer.Internal
 
diff --git a/Data/Binary/Defer/List.hs b/Data/Binary/Defer/List.hs
--- a/Data/Binary/Defer/List.hs
+++ b/Data/Binary/Defer/List.hs
@@ -2,8 +2,8 @@
 module Data.Binary.Defer.List(ListDefer, newListDefer, readListDefer) where
 
 import System.IO
+import System.IO.Unsafe (unsafePerformIO)
 import Control.Monad
-import Foreign (unsafePerformIO)
 
 import Data.Binary.Defer
 import Data.Binary.Defer.Internal
diff --git a/binarydefer.cabal b/binarydefer.cabal
--- a/binarydefer.cabal
+++ b/binarydefer.cabal
@@ -1,6 +1,6 @@
 name:            binarydefer
 build-type:      Simple
-version:         1.2.1
+version:         1.2.2
 license:         BSD3
 license-file:    LICENSE
 author:          Neil Mitchell <ndmitchell@gmail.com>
@@ -8,7 +8,7 @@
 synopsis:        Binary serialization with deferred loading
 description:     Binary serialization, but with delays.
 category:        Data
-build-depends:   base < 5
+build-depends:   base >= 4 && < 5
 exposed-modules: Data.Binary.Defer,
                  Data.Binary.Defer.List
                  Data.Binary.Defer.Internal
