diff --git a/Generics/RepLib/AbstractReps.hs b/Generics/RepLib/AbstractReps.hs
new file mode 100644
--- /dev/null
+++ b/Generics/RepLib/AbstractReps.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE TemplateHaskell, UndecidableInstances, ScopedTypeVariables,
+    MultiParamTypeClasses, FlexibleContexts, FlexibleInstances,
+    TypeSynonymInstances, GADTs
+  #-}
+
+
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  RepLib.LibADT
+-- License     :  BSD
+--
+-- Maintainer  :  sweirich@cis.upenn.edu
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- Abstract Reps for Common Abstract Datatypes
+--
+-----------------------------------------------------------------------------
+module Generics.RepLib.AbstractReps where
+
+import Generics.RepLib.R
+import Generics.RepLib.Derive
+import Language.Haskell.TH
+
+import qualified Data.Map
+import qualified Data.Set
+
+$(derive_abstract [''Data.Map.Map, ''Data.Set.Set])
diff --git a/Generics/RepLib/Derive.hs b/Generics/RepLib/Derive.hs
--- a/Generics/RepLib/Derive.hs
+++ b/Generics/RepLib/Derive.hs
@@ -4,6 +4,7 @@
            , ScopedTypeVariables
            , GADTs
            , GeneralizedNewtypeDeriving
+           , CPP
   #-}
 {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
 
@@ -43,7 +44,7 @@
 import Control.Monad (replicateM, zipWithM, liftM, liftM2, when)
 import Control.Monad.Writer (WriterT, MonadWriter(..), runWriterT, lift)
 import Control.Arrow ((***), second)
-import Control.Applicative ((<$>))
+import Control.Applicative ((<$>), Applicative)
 
 import Unsafe.Coerce
 
@@ -80,8 +81,13 @@
 -- while generating constructor representations.
 
 newtype QN a = QN { unQN :: WriterT (S.Set Int) Q a }
+#if MIN_VERSION_template_haskell(2,7,0)
+  deriving (Applicative, Functor, Monad, MonadWriter (S.Set Int))
+#else    
   deriving (Functor, Monad, MonadWriter (S.Set Int))
+#endif
 
+
 liftQN :: Q a -> QN a
 liftQN = QN . lift
 
@@ -93,9 +99,17 @@
   qReport b s           = liftQN $ qReport b s
   qRecover              = error "qRecover not implemented for QN"
   qReify n              = liftQN $ qReify n
+#if MIN_VERSION_template_haskell(2,7,0)
+  qReifyInstances n tys = liftQN $ qReifyInstances n tys
+#else
   qClassInstances n tys = liftQN $ qClassInstances n tys
+#endif
   qLocation             = liftQN qLocation
   qRunIO io             = liftQN $ qRunIO io                       
+#if MIN_VERSION_template_haskell(2,7,0)
+  qLookupName ns s      = liftQN $ qLookupName ns s
+  qAddDependentFile fp  = liftQN $ qAddDependentFile fp
+#endif
 
 -- Generate the representation for a data constructor.
 -- As our representation of data constructors evolves, so must this definition.
diff --git a/Generics/RepLib/Lib.hs b/Generics/RepLib/Lib.hs
--- a/Generics/RepLib/Lib.hs
+++ b/Generics/RepLib/Lib.hs
@@ -43,18 +43,26 @@
 import Generics.RepLib.R1
 import Generics.RepLib.RepAux
 import Generics.RepLib.PreludeReps()
+import Generics.RepLib.AbstractReps()
 
+import Data.List (inits)
+
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Map (Map)
+import qualified Data.Map as Map
+
 ------------------- Subtrees --------------------------
 -- there is no point in using R1 for subtrees
 -- From Mark P. Jones, Functional programming with
 -- overloading and higher-order polymorphism
 -- Also the same function as "children" from SYB III
 
--- | Produce all children of a datastructure with the same type.
--- Note that subtrees is available for all representable types. For those that
--- are not recursive datatypes, subtrees will always return the
--- empty list. But, these trivial instances are convenient to have
--- for the Shrink operation below.
+-- | Produce all children of a datastructure with the same type.  Note
+-- that subtrees is available for all representable types. For those
+-- that are not recursive datatypes, subtrees will always return the
+-- empty list. But, these trivial instances are convenient to have for
+-- the Shrink operation below.
 
 subtrees :: forall a. Rep a => a -> [a]
 subtrees x = [y | Just y <- gmapQ (cast :: Query (Maybe a)) x]
@@ -125,6 +133,10 @@
 instance (GSum a, GSum b) => GSum (a,b)
 instance (GSum a) => GSum [a]
 
+instance (Rep k, GSum a) => GSum (Map k a) where
+  gsum = gsum . Map.elems
+instance GSum a => GSum (Set a) where
+  gsum = gsum . Set.elems
 -------------------- Zero ------------------------------
 -- | Create a zero element of a type
 -- @
@@ -164,6 +176,12 @@
 instance (Zero a, Zero b) => Zero (a,b)
 instance Zero a => Zero [a]
 
+instance (Rep k, Rep a) => Zero (Map k a) where
+  zero = Map.empty
+  
+instance (Rep a) => Zero (Set a) where
+  zero = Set.empty
+
 ---------- Generate ------------------------------
 
 data GenerateD a = GenerateD { generateD :: Int -> [a] }
@@ -202,6 +220,14 @@
 instance (Generate a, Generate b) => Generate (a,b)
 instance Generate a => Generate [a]
 
+instance (Ord a, Generate a) => Generate (Set a) where
+  generate i = map Set.fromList (generate i)
+
+instance (Ord k, Generate k, Generate a) => Generate (Map k a) where
+  generate 0 = []
+  generate i = map Map.fromList 
+                 (inits [ (k, v) | k <- generate (i-1), v <- generate (i-1)])
+
 ------------ Enumerate -------------------------------
 -- note that this is not the same as the Enum class in the standard prelude
 
@@ -222,9 +248,29 @@
 enumerateR1 r1 = error ("No way to enumerate type: " ++ show r1)
 
 enumerateCons :: [Con EnumerateD a] -> [a]
-enumerateCons (Con emb rec:rest) = (map (to emb) (fromTupM enumerateD rec)) ++ (enumerateCons rest)
+enumerateCons (Con emb rec:rest) = 
+  (map (to emb) (fromTupM enumerateD rec)) ++ (enumerateCons rest)
 enumerateCons [] = []
 
+instance Enumerate Int
+instance Enumerate Char
+instance Enumerate Integer
+instance Enumerate Float
+instance Enumerate Double
+instance Enumerate Bool
+
+instance Enumerate ()
+instance (Enumerate a, Enumerate b) => Enumerate (a,b)
+
+-- doesn't really work for infinite types.
+instance Enumerate a => Enumerate [a]
+
+instance (Ord a, Enumerate a) => Enumerate (Set a) where
+   enumerate = map Set.fromList enumerate
+instance (Ord k, Enumerate k, Enumerate a) => Enumerate (Map k a) where
+   enumerate = map Map.fromList 
+                 (inits [ (k, v) | k <- enumerate, v <- enumerate])
+
 ----------------- Shrink (from SYB III) -------------------------------
 
 data ShrinkD a = ShrinkD { shrinkD :: a -> [a] }
@@ -257,6 +303,12 @@
 instance Shrink ()
 instance (Shrink a, Shrink b) => Shrink (a,b)
 
+instance (Ord a, Shrink a) => Shrink (Set a) where
+  shrink x = map Set.fromList (shrink (Set.toList x))
+  
+instance (Ord k, Shrink k, Shrink a)  => Shrink (Map k a) where
+  shrink m = map Map.fromList (shrink (Map.toList m))
+
 ------------ Reduce -------------------------------
 
 data RreduceD b a = RreduceD { rreduceD :: a -> b -> b }
@@ -303,6 +355,9 @@
 instance (Lreduce c a, Lreduce c b) => Lreduce c (a,b)
 instance Lreduce c a => Lreduce c[a]
 
+instance (Ord a, Lreduce b a) => Lreduce b (Set a) where
+  lreduce b a =  (lreduce b (Set.toList a))
+
 instance Rreduce b Int
 instance Rreduce b ()
 instance Rreduce b Char
@@ -310,6 +365,9 @@
 instance (Rreduce c a, Rreduce c b) => Rreduce c (a,b)
 instance Rreduce c a => Rreduce c[a]
 
+instance (Ord a, Rreduce b a) => Rreduce b (Set a) where
+  rreduce a b =  (rreduce (Set.toList a) b)
+
 -------------------- Fold -------------------------------
 -- | All of the functions below are defined using instances
 -- of the following class
@@ -369,3 +427,10 @@
 	 foldLeft op = lreduceR1 (rList1 (LreduceD  { lreduceD = op })
 					 (LreduceD { lreduceD = foldLeft op }))
 
+instance Fold Set where
+	 foldRight op x b = foldRight op (Set.toList x) b
+	 foldLeft op b x = foldLeft op b (Set.toList x)
+
+instance Fold (Map k) where
+  foldRight op x b = foldRight op (Map.elems x) b
+  foldLeft op b x = foldLeft op b (Map.elems x)
diff --git a/Generics/RepLib/R1.hs b/Generics/RepLib/R1.hs
--- a/Generics/RepLib/R1.hs
+++ b/Generics/RepLib/R1.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE TemplateHaskell
-           , UndecidableInstances
+{-# LANGUAGE 
+             UndecidableInstances
            , GADTs
            , ScopedTypeVariables
            , MultiParamTypeClasses
diff --git a/RepLib.cabal b/RepLib.cabal
--- a/RepLib.cabal
+++ b/RepLib.cabal
@@ -1,10 +1,12 @@
 name:           RepLib
-version:        0.5.1
+version:        0.5.2
 license:        BSD3
 license-file:   LICENSE
 build-type:     Simple
 cabal-version:  >= 1.6
-tested-with:    GHC == 7.0.1, GHC == 7.0.3, GHC == 7.0.4, GHC == 7.2.1
+tested-with:    GHC == 7.0.4,
+                GHC == 7.2.1,
+                GHC == 7.4.1
 author:         Stephanie Weirich
 maintainer:     Brent Yorgey <byorgey@cis.upenn.edu>
                 Chris Casinghino <ccasin@cis.upenn.edu>
@@ -21,8 +23,8 @@
   location: http://replib.googlecode.com/svn/trunk/
 
 Library
-  build-depends: base >= 4.3 && < 5, 
-                 template-haskell >= 2.4 && < 2.7, 
+  build-depends: base >= 4.3 && < 5,
+                 template-haskell >= 2.4 && < 2.8,
                  mtl >= 2.0 && < 2.1,
                  type-equality >= 0.1.0.2 && < 0.2,
                  containers >= 0.4 && < 0.5
@@ -37,5 +39,6 @@
     Generics.RepLib.Derive,
     Generics.RepLib.SYB.Aliases,
     Generics.RepLib.SYB.Schemes,
-    Generics.RepLib.Unify
+    Generics.RepLib.Unify,
+    Generics.RepLib.AbstractReps
   extensions: GADTs
