Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-serialise for openSUSE:Factory checked in at 2022-08-01 21:30:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-serialise (Old) and /work/SRC/openSUSE:Factory/.ghc-serialise.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-serialise" Mon Aug 1 21:30:28 2022 rev:7 rq:987087 version:0.2.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-serialise/ghc-serialise.changes 2021-11-11 21:37:16.868926247 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-serialise.new.1533/ghc-serialise.changes 2022-08-01 21:30:48.761727684 +0200 @@ -1,0 +2,15 @@ +Fri Apr 22 22:45:33 UTC 2022 - Peter Simons <psim...@suse.com> + +- Update serialise to version 0.2.5.0. + Upstream has edited the change log file since the last release in + a non-trivial way, i.e. they did more than just add a new entry + at the top. You can review the file at: + http://hackage.haskell.org/package/serialise-0.2.5.0/src/ChangeLog.md + +------------------------------------------------------------------- +Mon Mar 7 20:13:42 UTC 2022 - Peter Simons <psim...@suse.com> + +- Update serialise to version 0.2.4.0 revision 1. + Upstream has revised the Cabal build instructions on Hackage. + +------------------------------------------------------------------- Old: ---- serialise-0.2.4.0.tar.gz New: ---- serialise-0.2.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-serialise.spec ++++++ --- /var/tmp/diff_new_pack.akAVjL/_old 2022-08-01 21:30:49.641730209 +0200 +++ /var/tmp/diff_new_pack.akAVjL/_new 2022-08-01 21:30:49.645730221 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-serialise # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name serialise %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.4.0 +Version: 0.2.5.0 Release: 0 Summary: A binary serialisation library for Haskell values License: BSD-3-Clause ++++++ serialise-0.2.4.0.tar.gz -> serialise-0.2.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serialise-0.2.4.0/ChangeLog.md new/serialise-0.2.5.0/ChangeLog.md --- old/serialise-0.2.4.0/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 +++ new/serialise-0.2.5.0/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,10 +1,8 @@ # Revision history for serialise -## 0.2.4.0 -- 2021-10-31 +## 0.2.4.0 -- UNRELEASED -* Add instances for `Data.Void`, `strict`, and `these`. - -* Compatibility with GHC 9.0 and 9.2 +* Add instances for Data.Void, strict and these. ## 0.2.3.0 -- 2020-05-10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serialise-0.2.4.0/bench/micro/Micro/PkgAesonTH.hs new/serialise-0.2.5.0/bench/micro/Micro/PkgAesonTH.hs --- old/serialise-0.2.4.0/bench/micro/Micro/PkgAesonTH.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/serialise-0.2.5.0/bench/micro/Micro/PkgAesonTH.hs 2001-09-09 03:46:40.000000000 +0200 @@ -8,11 +8,10 @@ import Data.ByteString.Lazy as BS import Data.Maybe +deriveJSON defaultOptions ''Tree + serialise :: Tree -> BS.ByteString serialise = Aeson.encode deserialise :: BS.ByteString -> Tree deserialise = fromJust . Aeson.decode' - -deriveJSON defaultOptions ''Tree - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serialise-0.2.4.0/bench/versus/Macro/PkgAesonTH.hs new/serialise-0.2.5.0/bench/versus/Macro/PkgAesonTH.hs --- old/serialise-0.2.4.0/bench/versus/Macro/PkgAesonTH.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/serialise-0.2.5.0/bench/versus/Macro/PkgAesonTH.hs 2001-09-09 03:46:40.000000000 +0200 @@ -8,12 +8,6 @@ import Data.ByteString.Lazy as BS import Data.Maybe -serialise :: [GenericPackageDescription] -> BS.ByteString -serialise pkgs = Aeson.encode pkgs - -deserialise :: BS.ByteString -> [GenericPackageDescription] -deserialise = fromJust . Aeson.decode' - deriveJSON defaultOptions ''Version deriveJSON defaultOptions ''PackageName deriveJSON defaultOptions ''PackageId @@ -21,29 +15,35 @@ deriveJSON defaultOptions ''Dependency deriveJSON defaultOptions ''CompilerFlavor deriveJSON defaultOptions ''License -deriveJSON defaultOptions ''SourceRepo deriveJSON defaultOptions ''RepoKind deriveJSON defaultOptions ''RepoType +deriveJSON defaultOptions ''SourceRepo deriveJSON defaultOptions ''BuildType +deriveJSON defaultOptions ''ModuleName +deriveJSON defaultOptions ''Language +deriveJSON defaultOptions ''KnownExtension +deriveJSON defaultOptions ''Extension +deriveJSON defaultOptions ''BuildInfo deriveJSON defaultOptions ''Library deriveJSON defaultOptions ''Executable -deriveJSON defaultOptions ''TestSuite -deriveJSON defaultOptions ''TestSuiteInterface deriveJSON defaultOptions ''TestType -deriveJSON defaultOptions ''Benchmark -deriveJSON defaultOptions ''BenchmarkInterface +deriveJSON defaultOptions ''TestSuiteInterface +deriveJSON defaultOptions ''TestSuite deriveJSON defaultOptions ''BenchmarkType -deriveJSON defaultOptions ''BuildInfo -deriveJSON defaultOptions ''ModuleName -deriveJSON defaultOptions ''Language -deriveJSON defaultOptions ''Extension -deriveJSON defaultOptions ''KnownExtension +deriveJSON defaultOptions ''BenchmarkInterface +deriveJSON defaultOptions ''Benchmark deriveJSON defaultOptions ''PackageDescription deriveJSON defaultOptions ''OS deriveJSON defaultOptions ''Arch -deriveJSON defaultOptions ''Flag deriveJSON defaultOptions ''FlagName +deriveJSON defaultOptions ''Flag +deriveJSON defaultOptions ''Condition deriveJSON defaultOptions ''CondTree deriveJSON defaultOptions ''ConfVar -deriveJSON defaultOptions ''Condition deriveJSON defaultOptions ''GenericPackageDescription + +serialise :: [GenericPackageDescription] -> BS.ByteString +serialise pkgs = Aeson.encode pkgs + +deserialise :: BS.ByteString -> [GenericPackageDescription] +deserialise = fromJust . Aeson.decode' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serialise-0.2.4.0/serialise.cabal new/serialise-0.2.5.0/serialise.cabal --- old/serialise-0.2.4.0/serialise.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/serialise-0.2.5.0/serialise.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: serialise -version: 0.2.4.0 +version: 0.2.5.0 synopsis: A binary serialisation library for Haskell values. description: This package (formerly @binary-serialise-cbor@) provides pure, efficient @@ -36,7 +36,8 @@ GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1, - GHC == 9.0.1 + GHC == 9.0.1, + GHC == 9.2.2 extra-source-files: ChangeLog.md @@ -79,7 +80,7 @@ hashable >= 1.2 && < 2.0, primitive >= 0.5 && < 0.8, strict >= 0.4 && < 0.5, - text >= 1.1 && < 1.3, + text >= 1.1 && < 2.1, these >= 1.1 && < 1.2, unordered-containers >= 0.2 && < 0.3, vector >= 0.10 && < 0.13 @@ -128,7 +129,7 @@ bytestring >= 0.10.4 && < 0.12, directory >= 1.0 && < 1.4, filepath >= 1.0 && < 1.5, - text >= 1.1 && < 1.3, + text >= 1.1 && < 2.1, time >= 1.4 && < 1.14, containers >= 0.5 && < 0.7, unordered-containers >= 0.2 && < 0.3, @@ -218,7 +219,7 @@ criterion >= 1.0 && < 1.6, cereal >= 0.5.2.0 && < 0.6, cereal-vector >= 0.2 && < 0.3, - semigroups >= 0.18 && < 0.20, + semigroups >= 0.18 && < 0.21, store >= 0.7.1 && < 0.8 benchmark versus @@ -258,7 +259,7 @@ directory >= 1.0 && < 1.4, ghc-prim >= 0.3.1.0 && < 0.9, fail >= 4.9.0.0 && < 4.10, - text >= 1.1 && < 1.3, + text >= 1.1 && < 2.1, vector >= 0.10 && < 0.13, cborg, serialise, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serialise-0.2.4.0/src/Codec/Serialise/Tutorial.hs new/serialise-0.2.5.0/src/Codec/Serialise/Tutorial.hs --- old/serialise-0.2.4.0/src/Codec/Serialise/Tutorial.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/serialise-0.2.5.0/src/Codec/Serialise/Tutorial.hs 2001-09-09 03:46:40.000000000 +0200 @@ -9,33 +9,32 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) -- --- @cborg@ is a library for the serialisation of Haskell values. +-- @serialise@ library is built on @cborg@, they implement CBOR (Concise Binary Object Representation, specified by [IETF RFC 7049](https://tools.ietf.org/html/rfc7049)) and serialisers/deserializers for it. -- module Codec.Serialise.Tutorial - ( -- * Introduction + ( -- * Basic use example -- $introduction - -- ** The CBOR format + -- * The CBOR format -- $cbor_format + -- ** Interoperability with other CBOR implementations + -- $interoperability + -- * The 'Serialise' class -- $serialise - -- ** Encoding terms + -- ** How to write encoding terms -- $encoding - -- ** Decoding terms + -- ** How to write decoding terms -- $decoding -- * Migrations -- $migrations -- * Working with foreign encodings - -- | While @cborg@ is primarily designed to be a Haskell serialisation - -- library, the fact that it uses the standard CBOR encoding means that it can also - -- find uses in interacting with foreign non-@cborg@ producers and - -- consumers. In this section we will describe a few features of the library - -- which may be useful in such applications. + -- $foreign_encodings -- ** Working with arbitrary terms -- $arbitrary_terms @@ -45,19 +44,25 @@ ) where -- These are necessary for haddock to properly hyperlink +import Codec.Serialise import Codec.Serialise.Decoding import Codec.Serialise.Class +import Codec.CBOR.Term +import Codec.CBOR.FlatTerm +import Codec.CBOR.Pretty {- $introduction -As in modern serialisation libraries, @cborg@ offers -instance derivation via GHC's 'GHC.Generic' mechanism, +@serialise@ offers ability to derive instances via 'GHC.Generic' mechanism: > import Codec.Serialise > import qualified Data.ByteString.Lazy as BSL > +> fileName :: FilePath +> fileName = "out.cbor" +> > data Animal = HoppingAnimal { animalName :: String, hoppingHeight :: Int } -> | WalkingAnimal { animalName :: String, walkingSpeed :: Int } +> | WalkingAnimal { animalName :: String, walkingSpeed :: Int } > deriving (Generic) > > instance Serialise Animal @@ -65,41 +70,55 @@ > fredTheFrog :: Animal > fredTheFrog = HoppingAnimal "Fred" 4 > -> main = BSL.writeFile "hi" (serialise fredTheFrog) - -We can then later read Fred, - -> main = do -> fred <- deserialise <$> BSL.readFile "hi" -> print fred +> -- | To output value into a file +> write :: Serialise a => FilePath -> a -> IO () +> write file val = BSL.writeFile file (serialise val) +> +> -- | Outputs @Fred@ value into file +> writeIO :: IO () +> writeIO = write fileName fredTheFrog +> +> -- | Reads the value from file +> readIO :: IO Animal +> readIO = deserialise <$> BSL.readFile fileName +> +> printIO :: IO () +> printIO = do +> val <- readIO +> print val -} {- $cbor_format -@cborg@ uses the Concise Binary Object Representation, CBOR -(IETF RFC 7049, <https://tools.ietf.org/html/rfc7049>), as its serialised -representation. This encoding is efficient in both encoding\/decoding complexity -as well as space, and is generally machine-independent. - -The CBOR data model resembles that of JSON, having arrays, key\/value maps, -integers, floating point numbers, binary strings, and text. In addition, -CBOR allows items to be /tagged/ with a number which describes the type of data -that follows. This can be used both to identify which data constructor of a type -an encoding represents, as well as representing different versions of the same +CBOR encoding is efficient in encoding\/decoding complexity and space, and is generally machine-independent. + +CBOR data model has: + * integers + * floating point numbers + * binary strings + * text + * arrays + * key\/value maps +and resembles JSON. + +CBOR allows items to be /tagged/ with a number which identifies the type of data. +This can be used both to identify which data constructor of a type +is represented, as well as representing different versions of the same constructor. -=== A note on interoperability +-} + +{- $interoperability -@cborg@ is intended primarily as a /serialisation/ library for -Haskell values. That is, a means of stably storing Haskell values for later -reading by @cborg@. While it uses the CBOR encoding format, the -library is /not/ primarily aimed to facilitate serialisation and +Library provides means of stably storing Haskell values for later +reading by the library. + +The library is /not/ aimed to facilitate serialisation and deserialisation across different CBOR implementations. +But that is possible to setup practically. -If you want to use @cborg@ to serialise\/deserialise values -for\/from another CBOR implementation (either in Haskell or another language), -you should keep a few things in mind, +A few things on compatibility with other CBOR implementations: 1. The 'Serialise' instances for some "basic" Haskell types (e.g. 'Maybe', 'Data.ByteString.ByteString', tuples) don't carry a tag, in contrast to common @@ -111,12 +130,12 @@ non-backwards-compatible ways across super-major versions. For example the library may start producing a new representation for some type. The new version of the library will be able to decode the old and new representation, - but your different CBOR decoder would not be expecting the new representation + but different CBOR decoder would not be expecting the new representation and would have to be updated to match. 3. While the library tries to use standard encodings in its instances wherever possible, these instances aren't guaranteed to implement all valid variants of the - encodings in the specification. For instance, the 'UTCTime' instance only + RFCs/standards mentioned in the specification. For instance, the 'UTCTime' instance only implements a small subset of the encodings described by the Extended Date RFC. @@ -124,48 +143,47 @@ {- $serialise -@cborg@ provides a 'Serialise' class for convenient access to serialisers and -deserialisers. Writing a serialiser can be as simple as deriving 'Generic' and +'Serialise' class provides convenient access to serialisers and +deserialisers. + +Creating & using a serialiser can be as simple as deriving 'Generic' and 'Serialise', +> -- all GHCs +> data MyType = ... +> deriving (Generic) +> instance Serialise MyType +> > -- with DerivingStrategies (GHC 8.2 and newer) > data Animal = ... > deriving stock (Generic) > deriving anyclass (Serialise) -> -> -- older GHCs -> data MyType = ... -> deriving (Generic) -> instance Serialise MyType -Of course, you can also write the equivalent serialisers manually. -A hand-rolled 'Serialise' instance may be desireable for a variety -of reasons, +Of course, equivalent implementations can be handwritten. +A custom 'Serialise' instance may be desireable for a variety +of reasons: - * Deviating from the type-guided encoding that the 'Generic' instance will - provide + * deviating from the type-guided encoding that the 'Generic' instance provides - * Interfacing with other CBOR implementations + * interfacing with other CBOR implementations - * Enabling migrations for future changes to the type or its encoding + * managing migration changes to the type and its encoding -A minimal hand-rolled instance will define the 'encode' and 'decode' methods, +'encode' and 'decode' methods form a minimal `Serialise` instance definition: > instance Serialise Animal where > encode = encodeAnimal > decode = decodeAnimal -Below we will describe how to write these pieces. - -} {- $encoding For the purposes of encoding, abstract CBOR representations are embodied by the 'Codec.CBOR.Encoding.Tokens' type. Such a representation can be efficiently -built using the 'Codec.CBOR.Encoding.Encoding' 'Monoid'. +built using the 'Monoid' 'Codec.CBOR.Encoding.Encoding'. -For instance, to implement an encoder for the @Animal@ type above we might write, +For instance, to implement an encoder for the @Animal@ type above: > encodeAnimal :: Animal -> Encoding > encodeAnimal (HoppingAnimal name height) = @@ -173,16 +191,16 @@ > encodeAnimal (WalkingAnimal name speed) = > encodeListLen 3 <> encodeWord 1 <> encode name <> encode speed -Here we see that each encoding begins with a /length/, describing how many -values belonging to our @Animal@ will follow. We then encode a /tag/, which -identifies which constructor. We then encode the fields using their respective -'Serialise' instance. +Each encoding begins with a /length/, declaring how many +values belonging to @Animal@ constructor going to follow. Then a /tag/ which +identifies constructor. Fields are encoded using their respective +'Serialise' instances. -It is recommended that you not deviate from this encoding scheme, including both -the length and tag, to ensure that you have the option to migrate your types +It is recommended to not deviate from this encoding scheme - including both +the length and tag - to ensure to have the option to migrate types later on. -Also note that the recommended encoding represents Haskell constructor indexes +Note: the recommended encoding represents Haskell constructor indexes as CBOR words, not CBOR tags. -} @@ -190,8 +208,7 @@ {- $decoding Decoding CBOR representations to Haskell values is done in the 'Decoder' -'Monad'. We can write a 'Decoder' for the @Animal@ type defined above as -follows, +'Monad'. A 'decode' for the @Animal@ type would be: > decodeAnimal :: Decoder s Animal > decodeAnimal = do @@ -206,31 +223,30 @@ {- $migrations -One eventuality that data serialisation schemes need to account for is the need -for changes in the data's structure. There are two types of compatibility -which we might want to strive for in our serialisers, +One eventuality that data serialisation schemes need to account for +- is the future changes in the data's structure. + +There are two types of compatibility to strive for in serialisers: - * Backward compatibility, such that newer versions of the serialiser can read + * backward compatibility: newer versions of the serialiser can read older versions of an encoding - * Forward compatibility, such that older versions of the serialiser can read + * forward compatibility: older versions of the serialiser can read (or at least tolerate) newer versions of an encoding -Below we will look at a few of the types of changes which we may need to make -and describe how these can be handled in a backwards-compatible manner with -@cborg@. +Below are a few examples of how to provide backward-compatible serialisation. === Adding a constructor -Say we want to add a new constructor to our @Animal@ type, @SwimmingAnimal@, +Example: adding a new constructor to @Animal@ type, @SwimmingAnimal@, > data Animal = HoppingAnimal { animalName :: String, hoppingHeight :: Int } > | WalkingAnimal { animalName :: String, walkingSpeed :: Int } > | SwimmingAnimal { numberOfFins :: Int } > deriving (Generic) -We can account for this in our hand-rolled serialiser by simply adding a new tag -to our encoder and decoder, +To account for this in handwritten serialiser - add a new tag +to encoder and decoder, > encodeAnimal :: Animal -> Encoding > -- HoppingAnimal, SwimmingAnimal cases are unchanged... @@ -256,15 +272,15 @@ === Adding\/removing\/modifying fields -Say then we want to add a new field to our @WalkingAnimal@ constructor, +Example: adding a new field to @WalkingAnimal@ constructor, > data Animal = HoppingAnimal { animalName :: String, hoppingHeight :: Int } -> | WalkingAnimal { animalName :: String, walkingSpeed :: Int, numberOfFeet :: Int } +> | WalkingAnimal { animalName :: String, walkingSpeed :: Int, numberOfFeet :: Int } > | SwimmingAnimal { numberOfFins :: Int } > deriving (Generic) -We can account for this by representing @WalkingAnimal@ with a new encoding with -a new tag, +To account for this - represent @WalkingAnimal@ with a new encoding with +a new tag, while also providing default value for backward compatibility: > encodeAnimal :: Animal -> Encoding > -- HoppingAnimal, SwimmingAnimal cases are unchanged... @@ -290,15 +306,25 @@ > (4, 3) -> WalkingAnimal <$> decode <*> decode <*> decode > _ -> fail "invalid Animal encoding" -We can use this same approach to handle field removal and type changes. +The same approach can be used to handle field removal and type changes. + +-} + +{- $foreign_encodings + +While @serialise@ & @cborg@ are primarily designed to be a Haskell-only values serialisation +library, the fact that it implements the standard CBOR encoding means that it also can +find uses in interacting with foreign CBOR producers & +consumers. In this section we will describe a few features of the library +which may be useful in such applications. -} {- $arbitrary_terms When working with foreign encodings, it can sometimes be useful to capture a -serialised CBOR term verbatim (for instance, so you can later re-serialise it in -some later result). The 'Codec.CBOR.Term.Term' type provides such a +serialised CBOR term verbatim (for instance, to later re-serialise it in +some later result). The 'Codec.CBOR.Term.Term' type provides such representation, losslessly capturing a CBOR AST. It can be serialised and deserialised with its 'Serialise' instance. @@ -306,7 +332,7 @@ {- $examining_encodings -We can also look In addition to serialisation and deserialisation, @cborg@ +In addition to serialisation and deserialisation, @cborg@ provides a variety of tools for representing arbitrary CBOR encodings in the "Codec.CBOR.FlatTerm" and "Codec.CBOR.Pretty" modules. @@ -320,7 +346,7 @@ Right (HoppingAnimal {animalName = "Fred", hoppingHeight = 42}) This can be useful both for understanding external CBOR formats, as well as -understanding and testing your own hand-rolled encodings. +understanding and testing handwritten encodings. The package also includes a pretty-printer in "Codec.CBOR.Pretty", for visualising the CBOR wire protocol alongside its semantic structure. For instance,