packages feed

rakuten 0.1.0.6 → 0.1.1.0

raw patch · 2 files changed

+4/−22 lines, 2 filesdep −unordered-containersdep ~extensiblePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: unordered-containers

Dependency ranges changed: extensible

API changes (from Hackage documentation)

- Rakuten.Types.Class: instance Data.Extensible.Class.Forall (Data.Extensible.Field.KeyValue GHC.TypeLits.KnownSymbol Data.Aeson.Types.FromJSON.FromJSON) xs => Data.Aeson.Types.FromJSON.FromJSON (Data.Extensible.Field.Record xs)
- Rakuten.Types.Class: instance Data.Extensible.Class.Forall (Data.Extensible.Field.KeyValue GHC.TypeLits.KnownSymbol Data.Aeson.Types.ToJSON.ToJSON) xs => Data.Aeson.Types.ToJSON.ToJSON (Data.Extensible.Field.Record xs)

Files

rakuten.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4c66e879fbf9d4b953c523b0a460bbd3f5515f159b02f3c6e08848c33a205fad+-- hash: 556528d064276649ad99805bc4b9cbd3476bd530ad8b1b0ced4efaca208bb0cd  name:           rakuten-version:        0.1.0.6+version:        0.1.1.0 synopsis:       The Rakuten API in Haskell description:    See README at <https://github.com/matsubara0507/rakuten#readme> category:       Web@@ -34,7 +34,7 @@     , connection >=0.2.7 && <0.3     , constraints >=0.9.1 && <0.11     , data-default-class >=0.1.2.0 && <0.2-    , extensible >=0.4.1 && <0.4.7.2+    , extensible >=0.4.7.2 && <0.4.9     , http-api-data >=0.3.5 && <0.3.8     , http-client >=0.5.5.0 && <0.6     , http-client-tls >=0.3.3.1 && <0.4@@ -42,7 +42,6 @@     , lens >=4.15.3 && <5.0     , req >=0.3.0 && <1.1.0     , text >=1.2.2.1 && <1.3-    , unordered-containers >=0.2.8 && <0.3   exposed-modules:       Rakuten       Rakuten.Client@@ -71,7 +70,7 @@     , connection >=0.2.7 && <0.3     , constraints >=0.9.1 && <0.11     , data-default-class >=0.1.2.0 && <0.2-    , extensible >=0.4.1 && <0.4.7.2+    , extensible >=0.4.7.2 && <0.4.9     , hspec >=2.4.1 && <2.5     , http-api-data >=0.3.5 && <0.3.8     , http-client >=0.5.5.0 && <0.6@@ -81,7 +80,6 @@     , req >=0.3.0 && <1.1.0     , servant-server >=0.9.1.1 && <0.14     , text >=1.2.2.1 && <1.3-    , unordered-containers >=0.2.8 && <0.3     , warp >=3.2.11 && <3.3   other-modules:       Rakuten.Endpoints.IchibaSpec
src/Rakuten/Types/Class.hs view
@@ -12,33 +12,17 @@     ) where
 
 import           Control.Applicative   (liftA2)
-import           Data.Aeson            hiding (KeyValue)
 import           Data.Bool             (bool)
 import           Data.Constraint
 import           Data.Default.Class    (Default (..))
 import           Data.Extensible
 import           Data.Functor.Identity (Identity (..))
-import qualified Data.HashMap.Strict   as HM
 import           Data.Monoid           (Endo (..), (<>))
 import           Data.Proxy
 import           Data.String           (fromString)
 import           Data.Text             (Text)
 import           GHC.TypeLits          (KnownSymbol, symbolVal)
 import           Network.HTTP.Req      (QueryParam, (=:))
-
-instance Forall (KeyValue KnownSymbol FromJSON) xs => FromJSON (Record xs) where
-  parseJSON = withObject "Object" $
-    \v -> hgenerateFor (Proxy :: Proxy (KeyValue KnownSymbol FromJSON)) $
-    \m -> let k = symbolVal (proxyAssocKey m) in
-      case HM.lookup (fromString k) v of
-        Just a  -> Field . return <$> parseJSON a
-        Nothing -> fail $ "Missing key: " `mappend` k
-
-instance Forall (KeyValue KnownSymbol ToJSON) xs => ToJSON (Record xs) where
-  toJSON = Object . HM.fromList . flip appEndo [] . hfoldMap getConst' . hzipWith
-    (\(Comp Dict) -> Const' . Endo . (:) .
-      liftA2 (,) (fromString . symbolVal . proxyAssocKey) (toJSON . getField))
-    (library :: Comp Dict (KeyValue KnownSymbol ToJSON) :* xs)
 
 instance Default a => Default (Identity a) where
   def = Identity def