store 0.7.14 → 0.7.15
raw patch · 4 files changed
+28/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +7/−0
- README.md +5/−0
- src/Data/Store/Internal.hs +14/−0
- store.cabal +2/−2
ChangeLog.md view
@@ -1,5 +1,12 @@ # ChangeLog +## 0.7.15++* Adds support for `text >= 2`. See [#170][].++[#170]: https://github.com/mgsloan/store/issues/170++ ## 0.7.14 * Fixes build with ghc-8.10 (broken in last release due to differences
README.md view
@@ -59,6 +59,11 @@ to store all the elements. Malicious or malformed input could cause allocation of large amounts of memory. See [issue #122][]. +* Serialization may vary based on the version of datatypes. For+ example, `Text` serialized from `text < 2` will not be compatible+ with `Text` from `text >= 2`, because the internal representation+ switched from UTF-16 to UTF-8.+ [issue #122]: https://github.com/fpco/store/issues/122 ## Blog posts
src/Data/Store/Internal.hs view
@@ -443,8 +443,21 @@ peek = fmap LBS.fromStrict peek instance Store T.Text where+#if MIN_VERSION_text(2,0,0) size = VarSize $ \x -> sizeOf (undefined :: Int) ++ T.lengthWord8 x+ poke x = do+ let !(T.Text (TA.ByteArray array) w8Off w8Len) = x+ poke w8Len+ pokeFromByteArray array w8Off w8Len+ peek = do+ w8Len <- peek+ ByteArray array <- peekToByteArray "Data.Text.Text" w8Len+ return (T.Text (TA.ByteArray array) 0 w8Len)+#else+ size = VarSize $ \x ->+ sizeOf (undefined :: Int) + 2 * (T.lengthWord16 x) poke x = do let !(T.Text (TA.Array array) w16Off w16Len) = x@@ -454,6 +467,7 @@ w16Len <- peek ByteArray array <- peekToByteArray "Data.Text.Text" (2 * w16Len) return (T.Text (TA.Array array) 0 w16Len)+#endif ------------------------------------------------------------------------ -- Known size instances
store.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.5.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack name: store-version: 0.7.14+version: 0.7.15 synopsis: Fast binary serialization category: Serialization, Data homepage: https://github.com/mgsloan/store#readme