Hello community, here is the log from the commit of package ghc-text-conversions for openSUSE:Factory checked in at 2020-10-23 15:15:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-text-conversions (Old) and /work/SRC/openSUSE:Factory/.ghc-text-conversions.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-text-conversions" Fri Oct 23 15:15:00 2020 rev:5 rq:842767 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-text-conversions/ghc-text-conversions.changes 2020-09-30 19:53:43.292748780 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-text-conversions.new.3463/ghc-text-conversions.changes 2020-10-23 15:15:01.110153666 +0200 @@ -1,0 +2,14 @@ +Wed Sep 30 08:36:19 UTC 2020 - psim...@suse.com + +- Update text-conversions to version 0.3.1. + ## 0.3.1 (September 29th, 2020) + + - Added support for `base16-bytestring-1.0`. + + ## 0.3.0 (June 9, 2016) + + ### New Features + + - The `Base16` and `Base64` newtypes are now provided for managing safe conversions between binary data and Base16 and Base64 textual encodings of that data. + +------------------------------------------------------------------- Old: ---- text-conversions-0.3.0.tar.gz text-conversions.cabal New: ---- text-conversions-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-text-conversions.spec ++++++ --- /var/tmp/diff_new_pack.iYpjLg/_old 2020-10-23 15:15:02.242154212 +0200 +++ /var/tmp/diff_new_pack.iYpjLg/_new 2020-10-23 15:15:02.246154214 +0200 @@ -19,13 +19,12 @@ %global pkg_name text-conversions %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.3.0 +Version: 0.3.1 Release: 0 Summary: Safe conversions between textual types License: ISC URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-base16-bytestring-devel BuildRequires: ghc-base64-bytestring-devel @@ -35,7 +34,6 @@ BuildRequires: ghc-text-devel %if %{with tests} BuildRequires: ghc-hspec-devel -BuildRequires: ghc-hspec-discover-devel %endif %description @@ -54,7 +52,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ text-conversions-0.3.0.tar.gz -> text-conversions-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/CHANGELOG.md new/text-conversions-0.3.1/CHANGELOG.md --- old/text-conversions-0.3.0/CHANGELOG.md 2016-05-25 20:02:36.000000000 +0200 +++ new/text-conversions-0.3.1/CHANGELOG.md 2020-09-30 05:23:53.000000000 +0200 @@ -1,5 +1,15 @@ # Changelog +## 0.3.1 (September 29th, 2020) + +- Added support for `base16-bytestring-1.0`. + +## 0.3.0 (June 9, 2016) + +### New Features + +- The `Base16` and `Base64` newtypes are now provided for managing safe conversions between binary data and Base16 and Base64 textual encodings of that data. + ## 0.2.0 (May 25, 2016) ### Breaking Changes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/README.md new/text-conversions-0.3.1/README.md --- old/text-conversions-0.3.0/README.md 2016-05-25 20:07:04.000000000 +0200 +++ new/text-conversions-0.3.1/README.md 2020-09-21 16:30:10.000000000 +0200 @@ -1,4 +1,4 @@ -# text-conversions +# text-conversions [![Build Status](https://travis-ci.org/cjdev/text-conversions.svg?branch=master)](https://travis-ci.org/cjdev/text-conversions) This is a small library to ease the pain when converting between the many different string types in Haskell. Unlike some other libraries that attempt to solve the same problem, text-conversions is: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/package.yaml new/text-conversions-0.3.1/package.yaml --- old/text-conversions-0.3.0/package.yaml 2016-06-09 22:31:24.000000000 +0200 +++ new/text-conversions-0.3.1/package.yaml 2020-09-30 05:19:25.000000000 +0200 @@ -1,5 +1,5 @@ name: text-conversions -version: '0.3.0' +version: 0.3.1 category: Data synopsis: Safe conversions between textual types description: Safe conversions between textual types @@ -25,12 +25,12 @@ library: source-dirs: src dependencies: - - base >= 4.7 && < 5 - - bytestring - - base16-bytestring - - base64-bytestring - - errors - - text + - base >=4.7 && <5 + - bytestring <1 + - base16-bytestring <2 + - base64-bytestring <2 + - errors <3 + - text <2 tests: text-conversions-test-suite: @@ -45,5 +45,7 @@ - text-conversions - bytestring - hspec - - hspec-discover - text + verbatim: | + build-tool-depends: + hspec-discover:hspec-discover diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/src/Data/Text/Conversions.hs new/text-conversions-0.3.1/src/Data/Text/Conversions.hs --- old/text-conversions-0.3.0/src/Data/Text/Conversions.hs 2016-06-09 22:29:26.000000000 +0200 +++ new/text-conversions-0.3.1/src/Data/Text/Conversions.hs 2020-09-21 16:30:10.000000000 +0200 @@ -1,21 +1,21 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-| Module: Data.Text.Conversions This module provides a set of typeclasses for safely converting between - textual data. The built-in 'String' type, as well as strict 'Data.Text.Text' - and lazy 'Data.Text.Lazy.Text', are safely convertible between one another. - The 'Data.ByteString.ByteString' type is frequently treated in much the same - manner, but this is unsafe for two reasons: - - * Since 'Data.ByteString.ByteString' encodes binary data, it does not specify - a particular encoding, so assuming a particular encoding like UTF-8 would - be incorrect. + textual data. The built-in 'String' type, as well as strict 'T.Text' and lazy + 'TL.Text', are safely convertible between one another. The 'B.ByteString' type + is frequently treated in much the same manner, but this is unsafe for two + reasons: + + * Since 'B.ByteString' encodes binary data, it does not specify a particular + encoding, so assuming a particular encoding like UTF-8 would be incorrect. * Furthermore, decoding binary data into text given a particular encoding can - fail. Most systems simply use 'Data.Text.Encoding.decodeUtf8' and similar - functions, which will dangerously throw exceptions when given invalid data. + fail. Most systems simply use 'T.decodeUtf8' and similar functions, which + will dangerously throw exceptions when given invalid data. This module addresses both problems by providing a 'DecodeText' typeclass for decoding binary data in a way that can fail and by providing a 'UTF8' wrapper @@ -35,15 +35,17 @@ >>> decodeConvertText (UTF8 ("\xc3\x28" :: ByteString)) :: Maybe Text Nothing -} -module Data.Text.Conversions - ( Base16(..) - , Base64(..) - , DecodeText(..) - , FromText(..) +module Data.Text.Conversions ( + -- * Conversion typeclasses and functions + FromText(..) , ToText(..) - , UTF8(..) + , DecodeText(..) , convertText , decodeConvertText + -- * Encoding newtypes + , UTF8(..) + , Base16(..) + , Base64(..) ) where import Control.Error.Util (hush) @@ -63,7 +65,16 @@ {-| Simple wrapper type that is used to select a desired encoding when encoding or - decoding text from binary data, such as 'Data.ByteString.ByteString's. + decoding text from binary data, such as 'B.ByteString's. The conversion is not + partial; it will result in 'Nothing' when a 'B.ByteString' is provided with + data that is not valid in UTF-8. + + >>> convertText ("hello" :: Text) :: UTF8 ByteString + UTF8 "hello" + >>> decodeConvertText (UTF8 ("hello" :: ByteString)) :: Maybe Text + Just "hello" + >>> decodeConvertText (UTF8 ("invalid \xc3\x28" :: ByteString)) :: Maybe Text + Nothing -} newtype UTF8 a = UTF8 { unUTF8 :: a } deriving (Eq, Show, Functor) @@ -83,28 +94,28 @@ deriving (Eq, Show, Functor) {-| - A simple typeclass that handles converting arbitrary datatypes to - 'Data.Text.Text' when the operation cannot fail. If you have a type that - satisfies that requirement, implement this typeclass, but if the operation can - fail, use 'DecodeText' instead. + A simple typeclass that handles converting arbitrary datatypes to 'T.Text' + when the operation cannot fail. If you have a type that satisfies that + requirement, implement this typeclass, but if the operation can fail, use + 'DecodeText' instead. -} class ToText a where toText :: a -> T.Text {-| - A simple typeclass that handles converting 'Data.Text.Text' to arbitrary - datatypes. If you have a type that can be produced from text, implement this - typeclass, /not/ 'ConvertText'. However, you probably do not want to call - 'fromText' directly; call 'convertText', instead. + A simple typeclass that handles converting 'T.Text' to arbitrary datatypes. If + you have a type that can be produced from text, implement this typeclass. + However, you probably do not want to call 'fromText' directly; call + 'convertText', instead. -} class FromText a where fromText :: T.Text -> a {-| A simple typeclass that handles converting arbitrary datatypes to - 'Data.Text.Text' when the operation can fail. If you have a type that - satisfies that requirement, implement this typeclass, but if the operation - cannot fail, use 'ToText' instead. + 'T.Text' when the operation can fail. If you have a type that satisfies that + requirement, implement this typeclass, but if the operation cannot fail, use + 'ToText' instead. -} class Functor f => DecodeText f a where decodeText :: a -> f T.Text @@ -127,7 +138,7 @@ encodings, it is necessary to use a newtype that picks the particular encoding, like 'UTF8': - >>> convertText (UTF8 ("hello" :: ByteString)) :: Maybe Text + >>> decodeConvertText (UTF8 ("hello" :: ByteString)) :: Maybe Text Just "hello" -} decodeConvertText :: (DecodeText f a, FromText b) => a -> f b @@ -148,9 +159,15 @@ instance ToText (Base16 B.ByteString) where toText = T.decodeUtf8 . Base16.encode . unBase16 instance FromText (Maybe (Base16 B.ByteString)) where +#if MIN_VERSION_base16_bytestring(1,0,0) + fromText txt = case Base16.decode (T.encodeUtf8 txt) of + Right bs -> Just $ Base16 bs + Left _ -> Nothing +#else fromText txt = case Base16.decode (T.encodeUtf8 txt) of (bs, "") -> Just $ Base16 bs (_, _) -> Nothing +#endif instance ToText (Base64 B.ByteString) where toText = T.decodeUtf8 . Base64.encode . unBase64 @@ -160,9 +177,15 @@ instance ToText (Base16 BL.ByteString) where toText = TL.toStrict . TL.decodeUtf8 . Base16L.encode . unBase16 instance FromText (Maybe (Base16 BL.ByteString)) where +#if MIN_VERSION_base16_bytestring(1,0,0) + fromText txt = case Base16L.decode (TL.encodeUtf8 $ TL.fromStrict txt) of + Right bs -> Just $ Base16 bs + Left _ -> Nothing +#else fromText txt = case Base16L.decode (TL.encodeUtf8 $ TL.fromStrict txt) of (bs, "") -> Just $ Base16 bs (_, _) -> Nothing +#endif instance ToText (Base64 BL.ByteString) where toText = TL.toStrict . TL.decodeUtf8 . Base64L.encode . unBase64 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/stack.yaml new/text-conversions-0.3.1/stack.yaml --- old/text-conversions-0.3.0/stack.yaml 2016-05-25 01:30:53.000000000 +0200 +++ new/text-conversions-0.3.1/stack.yaml 2020-09-30 04:00:15.000000000 +0200 @@ -1,4 +1,4 @@ -resolver: lts-5.18 +resolver: lts-16.16 packages: ['.'] extra-deps: [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-conversions-0.3.0/text-conversions.cabal new/text-conversions-0.3.1/text-conversions.cabal --- old/text-conversions-0.3.0/text-conversions.cabal 2016-06-09 22:32:27.000000000 +0200 +++ new/text-conversions-0.3.1/text-conversions.cabal 2020-09-30 05:25:00.000000000 +0200 @@ -1,9 +1,13 @@ --- This file has been generated from package.yaml by hpack version 0.14.0. +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack +-- +-- hash: 7c0bf9ebe6887baff27c40e9fdb7bb6569b32eac6b9e701e2ab9355feb75353d name: text-conversions -version: 0.3.0 +version: 0.3.1 synopsis: Safe conversions between textual types description: Safe conversions between textual types category: Data @@ -14,13 +18,11 @@ license: ISC license-file: LICENSE build-type: Simple -cabal-version: >= 1.10 - extra-source-files: + README.md CHANGELOG.md LICENSE package.yaml - README.md stack.yaml source-repository head @@ -28,35 +30,39 @@ location: https://github.com/cjdev/text-conversions library + exposed-modules: + Data.Text.Conversions + other-modules: + Paths_text_conversions hs-source-dirs: src default-extensions: FlexibleInstances MultiParamTypeClasses OverloadedStrings ghc-options: -Wall build-depends: - base >= 4.7 && < 5 - , bytestring - , base16-bytestring - , base64-bytestring - , errors - , text - exposed-modules: - Data.Text.Conversions + base >=4.7 && <5 + , base16-bytestring <2 + , base64-bytestring <2 + , bytestring <1 + , errors <3 + , text <2 default-language: Haskell2010 test-suite text-conversions-test-suite type: exitcode-stdio-1.0 main-is: Main.hs + other-modules: + Data.Text.ConversionsSpec + Paths_text_conversions hs-source-dirs: test default-extensions: FlexibleInstances MultiParamTypeClasses OverloadedStrings ghc-options: -Wall -rtsopts -threaded -with-rtsopts=-N build-depends: base - , text-conversions , bytestring , hspec - , hspec-discover , text - other-modules: - Data.Text.ConversionsSpec + , text-conversions default-language: Haskell2010 + build-tool-depends: + hspec-discover:hspec-discover