diff --git a/disjoint-containers.cabal b/disjoint-containers.cabal
--- a/disjoint-containers.cabal
+++ b/disjoint-containers.cabal
@@ -1,5 +1,5 @@
 name: disjoint-containers
-version: 0.2.0
+version: 0.2.1
 synopsis: Disjoint containers
 description: Disjoint containers
 homepage: https://github.com/andrewthad/disjoint-containers#readme
@@ -21,7 +21,7 @@
   build-depends:
       base >= 4.7 && < 5
     , transformers >= 0.5 && < 0.6
-    , containers >= 0.5.10 && < 0.6
+    , containers >= 0.5 && < 0.6
   default-language: Haskell2010
 
 test-suite test
diff --git a/src/Data/DisjointMap.hs b/src/Data/DisjointMap.hs
--- a/src/Data/DisjointMap.hs
+++ b/src/Data/DisjointMap.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE DeriveFunctor #-}
 {-# LANGUAGE DeriveFoldable #-}
 {-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE CPP #-}
 
 {-# OPTIONS_GHC -Wall #-}
 
@@ -194,12 +195,19 @@
     class.
 -}
 singletons :: Eq k => Set k -> v -> DisjointMap k v
-singletons s v = case S.lookupMin s of
+singletons s v = case setLookupMin s of
   Nothing -> empty
   Just x ->
     let p = M.fromSet (\_ -> x) s
         r = M.singleton x (Ranked 1 s v)
     in DisjointMap p r
+
+setLookupMin :: Set a -> Maybe a
+#if MIN_VERSION_containers(0,5,9) 
+setLookupMin = S.lookupMin
+#else
+setLookupMin s = if S.size s > 0 then Just (S.findMin s) else Nothing
+#endif
 
 {-|
 Find the set representative for this input. Returns a new disjoint
diff --git a/src/Data/DisjointSet.hs b/src/Data/DisjointSet.hs
--- a/src/Data/DisjointSet.hs
+++ b/src/Data/DisjointSet.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 
 {-# OPTIONS_GHC -Wall #-}
 
@@ -186,12 +187,19 @@
 
 {-| Create a disjoint set where all members are equal. -}
 singletons :: Eq a => Set a -> DisjointSet a
-singletons s = case S.lookupMin s of
+singletons s = case setLookupMin s of
   Nothing -> empty
   Just x ->
     let p = M.fromSet (\_ -> x) s
         r = M.singleton x 1
     in DisjointSet p r
+
+setLookupMin :: Set a -> Maybe a
+#if MIN_VERSION_containers(0,5,9) 
+setLookupMin = S.lookupMin
+#else
+setLookupMin s = if S.size s > 0 then Just (S.findMin s) else Nothing
+#endif
 
 {-|
 Find the set representative for this input. Returns a new disjoint
