store 0.7.11 → 0.7.12
raw patch · 5 files changed
+39/−9 lines, 5 filesdep ~basedep ~vectorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, vector
API changes (from Hackage documentation)
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CBlkCnt
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CBlkSize
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CCc
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CClockId
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CDev
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CFsBlkCnt
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CFsFilCnt
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CGid
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CId
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CIno
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CKey
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CMode
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CNfds
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CNlink
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.COff
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CPid
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CRLim
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CSocklen
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CSpeed
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CSsize
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CTcflag
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CTimer
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.CUid
+ Data.Store.Internal: instance Data.Store.Impl.Store System.Posix.Types.Fd
+ Data.Store.TH.Internal: deriveGenericInstanceFromName :: Name -> Q Dec
Files
- ChangeLog.md +4/−0
- src/Data/Store/Internal.hs +19/−7
- src/Data/Store/TH/Internal.hs +6/−0
- store.cabal +2/−2
- test/Data/StoreSpec.hs +8/−0
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog +## 0.7.12++* Build with ghc-9.0.1+ ## 0.7.11 * Fixes testsuite compilation with `network >= 3.1.2`. See [#159][].
src/Data/Store/Internal.hs view
@@ -85,6 +85,7 @@ import Data.HashMap.Strict (HashMap) import Data.HashSet (HashSet) import Data.Hashable (Hashable)+import Data.Int import Data.IntMap (IntMap) import qualified Data.IntMap.Strict as IntMap import Data.IntSet (IntSet)@@ -158,6 +159,16 @@ #endif #endif +-- TODO: higher arities? Limited now by Generics instances for tuples+$(return $ map deriveTupleStoreInstance [2..7])++$(deriveManyStoreFromStorable+ (\ty ->+ case ty of+ ConT n | elem n [''Char, ''Int, ''Int64, ''Word, ''Word8, ''Word32] -> True+ _ -> False+ ))+ ------------------------------------------------------------------------ -- Utilities for defining list-like 'Store' instances in terms of 'IsSequence' @@ -483,7 +494,11 @@ let numTy = litT $ numTyLit $ natVal (Proxy :: Proxy n) [| StaticSize $(lift x) :: StaticSize $(numTy) $(tyq) |] +#if MIN_VERSION_template_haskell(2,17,0)+staticByteStringExp :: Quote m => BS.ByteString -> m Exp+#else staticByteStringExp :: BS.ByteString -> ExpQ+#endif staticByteStringExp bs = [| StaticSize bs :: StaticSize $(litT (numTyLit (fromIntegral len))) BS.ByteString |] where@@ -726,6 +741,8 @@ -- Similarly, manual implementation due to no Generic instance for -- Complex and Identity in GHC-7.10 and earlier. +$($(derive [d| instance Deriving (Store (Fixed a)) |]))+ instance Store Time.DiffTime where size = contramap (realToFrac :: Time.DiffTime -> Pico) size poke = poke . (realToFrac :: Time.DiffTime -> Pico)@@ -758,8 +775,6 @@ instance Deriving (Store Bool) instance (Store a, Store b) => Deriving (Store (Either a b)) - instance Deriving (Store (Fixed a))- instance Deriving (Store Time.AbsoluteTime) instance Deriving (Store Time.Day) instance Deriving (Store Time.LocalTime)@@ -789,8 +804,7 @@ |])) --- TODO: higher arities? Limited now by Generics instances for tuples-$(return $ map deriveTupleStoreInstance [2..7])+$(deriveManyStorePrimVector) $(deriveManyStoreUnboxVector) @@ -817,8 +831,6 @@ _ -> True )) -$(deriveManyStorePrimVector)- $(reifyManyWithoutInstances ''Store [''ModName, ''NameSpace, ''PkgName] (const True) >>= mapM (\name -> return (deriveGenericInstance [] (ConT name)))) @@ -864,4 +876,4 @@ #endif $(reifyManyWithoutInstances ''Store [''Info] (const True) >>=- mapM (\name -> return (deriveGenericInstance [] (ConT name))))+ mapM deriveGenericInstanceFromName)
src/Data/Store/TH/Internal.hs view
@@ -13,6 +13,7 @@ deriveManyStoreFromStorable , deriveTupleStoreInstance , deriveGenericInstance+ , deriveGenericInstanceFromName , deriveManyStorePrimVector , deriveManyStoreUnboxVector , deriveStore@@ -261,6 +262,11 @@ deriveGenericInstance :: Cxt -> Type -> Dec deriveGenericInstance cs ty = plainInstanceD cs (AppT (ConT ''Store) ty) []++deriveGenericInstanceFromName :: Name -> Q Dec+deriveGenericInstanceFromName n = do+ tvs <- map VarT . dtTvs <$> reifyDataType n+ return $ deriveGenericInstance (map storePred tvs) (appsT (ConT n) tvs) ------------------------------------------------------------------------ -- Storable
store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 549602d6bd9e31fc5c98384ab6bbb7e67b7f176ba9366aba8d2241154ee91698+-- hash: d81ae535cb7e6292f33518af0a5a35a6bfdcba26633b44b984a68afdabe1afac name: store-version: 0.7.11+version: 0.7.12 synopsis: Fast binary serialization category: Serialization, Data homepage: https://github.com/mgsloan/store#readme
test/Data/StoreSpec.hs view
@@ -60,6 +60,9 @@ import GHC.Fingerprint.Type (Fingerprint(..)) import GHC.Generics import GHC.Real (Ratio(..))+#if MIN_VERSION_base(4,15,0)+import GHC.RTS.Flags (IoSubSystem(..))+#endif import Language.Haskell.TH import Language.Haskell.TH.Syntax import Network.Socket@@ -249,6 +252,11 @@ series = uncurry Time.UTCTime <$> (series >< series) instance (Monad m, Serial m a) => Serial m (Tagged a)++#if MIN_VERSION_base(4,15,0)+instance Monad m => Serial m IoSubSystem where+ series = cons0 IoPOSIX \/ cons0 IoNative+#endif #if !MIN_VERSION_smallcheck(1,2,0) instance (Monad m, Serial m a) => Serial m (Complex a) where