packages feed

store 0.4.3 → 0.4.3.1

raw patch · 4 files changed

+24/−18 lines, 4 filesdep ~basedep ~template-haskellPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, template-haskell

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog +## 0.4.3.1++* Fixed compilation on GHC 7.8+ ## 0.4.3  * Less aggressive inlining, resulting in faster compilation / simplifier
src/Data/Store/TH.hs view
@@ -7,10 +7,16 @@ -- do not, then instead use "TH.Derive" like this: -- -- @---     data Foo = Foo Int | Bar Int+--     {-# LANGUAGE TemplateHaskell #-}+--     {-# LANGUAGE ScopedTypeVariables #-} --+--     import TH.Derive+--     import Data.Store+--+--     data Foo a = Foo a | Bar Int+-- --     $($(derive [d|---         instance Deriving (Store Foo)+--         instance Store a => Deriving (Store (Foo a)) --         |])) -- @ --
src/Data/Store/TH/Internal.hs view
@@ -63,8 +63,8 @@ makeStore :: Name -> Q [Dec] makeStore name = do     dt <- reifyDataType name-    preds <- mapM (\tv -> [t| Store $(varT tv) |]) (dtTvs dt)-    let argTy = appsT (ConT name) (map VarT (dtTvs dt))+    let preds = map (storePred . VarT) (dtTvs dt)+        argTy = appsT (ConT name) (map VarT (dtTvs dt))     (:[]) <$> deriveStore preds argTy (dtCons dt)  deriveStore :: Cxt -> Type -> [DataCon] -> Q Dec@@ -257,16 +257,10 @@  deriveTupleStoreInstance :: Int -> Dec deriveTupleStoreInstance n =-    deriveGenericInstance (map storeCxt tvs)+    deriveGenericInstance (map storePred tvs)                           (foldl1 AppT (TupleT n : tvs))   where     tvs = take n (map (VarT . mkName . (:[])) ['a'..'z'])-    storeCxt ty =-#if MIN_VERSION_template_haskell(2,10,0)-        AppT (ConT ''Store) ty-#else-        ClassP ''Store [ty]-#endif  deriveGenericInstance :: Cxt -> Type -> Dec deriveGenericInstance cs ty = plainInstanceD cs (AppT (ConT ''Store) ty) []@@ -350,12 +344,6 @@                     concatMap (map snd . dcFields) cons             -}             let extraPreds = map (storePred . AppT (ConT ''UV.Vector)) $ listify isVarT ty-                storePred =-#if MIN_VERSION_template_haskell(2,10,0)-                    AppT (ConT ''Store)-#else-                    ClassP ''Store . (:[])-#endif             deriveStore (nub (preds ++ extraPreds)) ty cons         _ -> fail "impossible case in deriveManyStoreUnboxVector" @@ -437,3 +425,11 @@ getTyHead (ForallT _ _ x) = getTyHead x getTyHead (AppT l _) = getTyHead l getTyHead x = x++storePred :: Type -> Pred+storePred ty =+#if MIN_VERSION_template_haskell(2,10,0)+        AppT (ConT ''Store) ty+#else+        ClassP ''Store [ty]+#endif
store.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           store-version:        0.4.3+version:        0.4.3.1 synopsis:       Fast binary serialization category:       Serialization, Data homepage:       https://github.com/fpco/store#readme