Commits

Bryan O'Sullivan  committed bc142e5

Move Monoid instances to aeson

  • Participants
  • Parent commits 7e5a140

Comments (0)

Files changed (2)

 name:                riak
-version:             0.1.0.0
+version:             0.1.0.1
 synopsis:            A Haskell client for the Riak decentralized data store
 description:
   A Haskell client library for the Riak decentralized data
     Network.Riak.Protocol
   
   build-depends:       
-    aeson,
+    aeson == 0.1.*,
     attoparsec >= 0.8.4.0,
     base == 4.*,
     binary,

File src/Network/Riak/JSON/Monoid.hs

     ) where
 
 import Data.Aeson.Types (FromJSON(..), ToJSON(..))
-import Data.Monoid (Dual(..), First(..), Last(..), Monoid)
+import Data.Monoid (Monoid)
 import Network.Riak.Types.Internal hiding (MessageTag(..))
 import qualified Network.Riak.JSON as J
 import qualified Network.Riak.Monoid as M
 
-instance ToJSON a => ToJSON (Dual a) where
-    toJSON = toJSON . getDual
-    {-# INLINE toJSON #-}
-
-instance FromJSON a => FromJSON (Dual a) where
-    fromJSON = fmap Dual . fromJSON
-    {-# INLINE fromJSON #-}
-
-instance ToJSON a => ToJSON (First a) where
-    toJSON = toJSON . getFirst
-    {-# INLINE toJSON #-}
-
-instance FromJSON a => FromJSON (First a) where
-    fromJSON = fmap First . fromJSON
-    {-# INLINE fromJSON #-}
-
-instance ToJSON a => ToJSON (Last a) where
-    toJSON = toJSON . getLast
-    {-# INLINE toJSON #-}
-
-instance FromJSON a => FromJSON (Last a) where
-    fromJSON = fmap Last . fromJSON
-    {-# INLINE fromJSON #-}
-
 -- | Retrieve a single value.  If conflicting values are returned, the
 -- 'Monoid' is used to choose a winner.
 get :: (FromJSON c, ToJSON c, Monoid c) =>