Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-optparse-generic for openSUSE:Factory checked in at 2021-09-13 16:24:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-optparse-generic (Old) and /work/SRC/openSUSE:Factory/.ghc-optparse-generic.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-optparse-generic" Mon Sep 13 16:24:34 2021 rev:5 rq:918033 version:1.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-optparse-generic/ghc-optparse-generic.changes 2021-08-25 20:58:46.753116214 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-optparse-generic.new.1899/ghc-optparse-generic.changes 2021-09-13 16:25:22.254802960 +0200 @@ -1,0 +2,9 @@ +Thu Sep 2 08:33:00 UTC 2021 - psim...@suse.com + +- Update optparse-generic to version 1.4.5. + 1.4.5 + + * [Add ability to set the short name in the type](https://github.com/Gabriel439/Haskell-Optparse-Generic-Library/pull/84) + * [Display default values in `--help` output](https://github.com/Gabriel439/Haskell-Optparse-Generic-Library/pull/83) + +------------------------------------------------------------------- Old: ---- optparse-generic-1.4.4.tar.gz optparse-generic.cabal New: ---- optparse-generic-1.4.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-optparse-generic.spec ++++++ --- /var/tmp/diff_new_pack.giwpMA/_old 2021-09-13 16:25:22.774803561 +0200 +++ /var/tmp/diff_new_pack.giwpMA/_new 2021-09-13 16:25:22.778803565 +0200 @@ -18,13 +18,12 @@ %global pkg_name optparse-generic Name: ghc-%{pkg_name} -Version: 1.4.4 +Version: 1.4.5 Release: 0 Summary: Auto-generate a command-line parser for your datatype License: BSD-3-Clause 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/3.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-Only-devel BuildRequires: ghc-bytestring-devel @@ -57,7 +56,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ optparse-generic-1.4.4.tar.gz -> optparse-generic-1.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-generic-1.4.4/CHANGELOG.md new/optparse-generic-1.4.5/CHANGELOG.md --- old/optparse-generic-1.4.4/CHANGELOG.md 2020-10-01 07:06:31.000000000 +0200 +++ new/optparse-generic-1.4.5/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,8 @@ +1.4.5 + +* [Add ability to set the short name in the type](https://github.com/Gabriel439/Haskell-Optparse-Generic-Library/pull/84) +* [Display default values in `--help` output](https://github.com/Gabriel439/Haskell-Optparse-Generic-Library/pull/83) + 1.4.4 * `readIntegralBounded`: use `metavar` in error message diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-generic-1.4.4/optparse-generic.cabal new/optparse-generic-1.4.5/optparse-generic.cabal --- old/optparse-generic-1.4.4/optparse-generic.cabal 2020-10-01 07:06:31.000000000 +0200 +++ new/optparse-generic-1.4.5/optparse-generic.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ Name: optparse-generic -Version: 1.4.4 +Version: 1.4.5 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 @@ -27,12 +27,12 @@ base >= 4.6 && < 5 , system-filepath >= 0.3.1 && < 0.5 , text < 1.3 , - transformers >= 0.2.0.0 && < 0.6 , + transformers >= 0.2.0.0 && < 0.7 , Only < 0.2 , optparse-applicative >= 0.16.0.0 && < 0.17, - time >= 1.5 && < 1.10, + time >= 1.5 && < 1.13, void < 0.8 , - bytestring < 0.11 + bytestring < 0.12 if impl(ghc < 8.0) Build-Depends: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-generic-1.4.4/src/Options/Generic.hs new/optparse-generic-1.4.5/src/Options/Generic.hs --- old/optparse-generic-1.4.4/src/Options/Generic.hs 2020-10-01 07:06:31.000000000 +0200 +++ new/optparse-generic-1.4.5/src/Options/Generic.hs 2001-09-09 03:46:40.000000000 +0200 @@ -310,6 +310,7 @@ -- * Help , type (<?>)(..) , type (<!>)(..) + , type (<#>)(..) , type (:::) , Wrapped , Unwrapped @@ -330,6 +331,7 @@ import Control.Monad.IO.Class (MonadIO(..)) import Data.Char (isUpper, toLower, toUpper) import Data.Int (Int8, Int16, Int32, Int64) +import Data.Maybe (listToMaybe) import Data.Monoid import Data.List.NonEmpty (NonEmpty((:|))) import Data.Proxy @@ -418,6 +420,7 @@ <> foldMap (Options.help . Data.Text.unpack) h <> foldMap Options.short c <> foldMap Options.value (d >>= Text.Read.readMaybe) + <> foldMap (Options.showDefaultWith . const) d Options.option readField fs {-| The only reason for this method is to provide a special case for @@ -518,7 +521,7 @@ <> Options.long (Data.Text.unpack name) <> foldMap (Options.help . Data.Text.unpack) h <> foldMap Options.short c - <> foldMap Options.value d + <> foldMap ((Options.showDefault <>) . Options.value) d Options.option Options.str fs instance ParseField Data.Text.Text where @@ -683,6 +686,26 @@ parseFields h m c _ = DefValue <$> parseFields h m c (Just (symbolVal (Proxy :: Proxy d))) instance (ParseFields a, KnownSymbol h) => ParseRecord (a <!> h) +{-| Use this to annotate a field with a type-level char (i.e. a `Symbol`) + representing the short name of the field (only the first character of the + symbol is used): + +> data Example = Example +> { foo :: Int <#> "f" +> , bar :: Double <#> "b" +> } deriving (Generic, Show) +-} +newtype (<#>) (field :: *) (value :: Symbol) = ShortName { unShortName :: field } deriving (Generic, Show) + +instance (ParseField a, KnownSymbol c) => ParseField (a <#> c) where + parseField h m _ d = ShortName <$> parseField h m (listToMaybe (symbolVal (Proxy :: Proxy c))) d + readField = ShortName <$> readField + metavar _ = metavar (Proxy :: Proxy a) + +instance (ParseFields a, KnownSymbol c) => ParseFields (a <#> c) where + parseFields h m _ d = ShortName <$> parseFields h m (listToMaybe (symbolVal (Proxy :: Proxy c))) d +instance (ParseFields a, KnownSymbol h) => ParseRecord (a <#> h) + {-| A 1-tuple, used solely to translate `ParseFields` instances into `ParseRecord` instances -} @@ -1172,6 +1195,7 @@ type family Unwrap ty where Unwrap (ty <?> helper) = Unwrap ty Unwrap (ty <!> defVal) = Unwrap ty + Unwrap (ty <#> shrtNm) = Unwrap ty Unwrap ty = ty infixr 0 ::: @@ -1212,6 +1236,10 @@ => GenericUnwrappable (K1 i (field <!> defVal)) (K1 i c) where genericUnwrap (K1 c) = (genericUnwrap :: K1 i field p -> K1 i c p) (K1 (unDefValue c)) +instance GenericUnwrappable (K1 i field) (K1 i c) + => GenericUnwrappable (K1 i (field <#> defVal)) (K1 i c) where + genericUnwrap (K1 c) = (genericUnwrap :: K1 i field p -> K1 i c p) (K1 (unShortName c)) + -- | Unwrap the fields of a constructor unwrap :: forall f . Unwrappable f => f Wrapped -> f Unwrapped unwrap = to . genericUnwrap . from