Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-microlens for openSUSE:Factory checked in at 2022-08-01 21:30:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-microlens (Old) and /work/SRC/openSUSE:Factory/.ghc-microlens.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-microlens" Mon Aug 1 21:30:08 2022 rev:21 rq:987061 version:0.4.13.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-microlens/ghc-microlens.changes 2020-12-22 11:42:38.073677622 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-microlens.new.1533/ghc-microlens.changes 2022-08-01 21:30:22.789653172 +0200 @@ -1,0 +2,8 @@ +Tue May 17 06:12:58 UTC 2022 - Peter Simons <[email protected]> + +- Update microlens to version 0.4.13.0. + # 0.4.13.0 + + * Added `_Show`, `worded`, and `lined`. + +------------------------------------------------------------------- Old: ---- microlens-0.4.12.0.tar.gz New: ---- microlens-0.4.13.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-microlens.spec ++++++ --- /var/tmp/diff_new_pack.vK9Axd/_old 2022-08-01 21:30:23.397654917 +0200 +++ /var/tmp/diff_new_pack.vK9Axd/_new 2022-08-01 21:30:23.401654928 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-microlens # -# Copyright (c) 2020 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 @@ -18,7 +18,7 @@ %global pkg_name microlens Name: ghc-%{pkg_name} -Version: 0.4.12.0 +Version: 0.4.13.0 Release: 0 Summary: A tiny lens library with no dependencies License: BSD-3-Clause ++++++ microlens-0.4.12.0.tar.gz -> microlens-0.4.13.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.12.0/CHANGELOG.md new/microlens-0.4.13.0/CHANGELOG.md --- old/microlens-0.4.12.0/CHANGELOG.md 2020-11-17 07:42:12.000000000 +0100 +++ new/microlens-0.4.13.0/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,7 @@ +# 0.4.13.0 + +* Added `_Show`, `worded`, and `lined`. + # 0.4.12.0 * Added instance `Ixed (NonEmpty a)` for GHC >= 8. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.12.0/microlens.cabal new/microlens-0.4.13.0/microlens.cabal --- old/microlens-0.4.12.0/microlens.cabal 2020-11-17 07:42:12.000000000 +0100 +++ new/microlens-0.4.13.0/microlens.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: microlens -version: 0.4.12.0 +version: 0.4.13.0 synopsis: A tiny lens library with no dependencies description: NOTE: If you're writing an app, you probably want <http://hackage.haskell.org/package/microlens-platform microlens-platform> ??? it has the most features. <http://hackage.haskell.org/package/microlens microlens> is intended more for library writers who want a tiny lens library (after all, lenses are pretty useful for everything, not just for updating records!). @@ -32,7 +32,7 @@ license: BSD3 license-file: LICENSE author: Edward Kmett, Artyom Kazak -maintainer: Monadfix <[email protected]> +maintainer: Steven Fontanella <[email protected]> homepage: http://github.com/monadfix/microlens bug-reports: http://github.com/monadfix/microlens/issues -- copyright: @@ -41,16 +41,17 @@ extra-source-files: CHANGELOG.md cabal-version: >=1.10 -tested-with: GHC==7.4.2 - GHC==7.6.3 +tested-with: GHC==7.6.3 GHC==7.8.4 GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 GHC==8.4.4 GHC==8.6.5 - GHC==8.8.1 - GHC==8.10.1 + GHC==8.8.4 + GHC==8.10.7 + GHC==9.0.1 + GHC==9.2.1 source-repository head type: git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.12.0/src/Lens/Micro.hs new/microlens-0.4.13.0/src/Lens/Micro.hs --- old/microlens-0.4.12.0/src/Lens/Micro.hs 2020-01-29 01:56:21.000000000 +0100 +++ new/microlens-0.4.13.0/src/Lens/Micro.hs 2001-09-09 03:46:40.000000000 +0200 @@ -93,11 +93,13 @@ ix, _head, _tail, _init, _last, mapAccumLOf, + worded, lined, -- * Prism: a traversal iterating over at most 1 element -- $prisms-note _Left, _Right, _Just, _Nothing, + _Show, -- * Other types LensLike, LensLike', @@ -111,6 +113,7 @@ import Control.Applicative import Control.Monad import Data.Functor.Identity +import Data.List (intercalate) import Data.Monoid import Data.Maybe import Data.Tuple @@ -118,6 +121,8 @@ #if MIN_VERSION_base(4,8,0) import Data.Function ((&)) +#else +import Data.Traversable (traverse) #endif #if MIN_VERSION_base(4,11,0) @@ -1260,6 +1265,37 @@ g a = state $ \acc -> swap (f acc a) {-# INLINE mapAccumLOf #-} +{- | +Focus on the 'words' of a string. + +>>> "avoid success at all costs" & worded . _head %~ toUpper +"Avoid Success At All Costs" + +This violates the traversal laws when whitespace is set or when the source has +space at the ends or more than one contiguous space anywhere. +-} +worded :: Traversal' String String +worded f = fmap unwords . traverse f . words +{-# INLINE worded #-} + +{- | +Focus on the 'lines' of a string. + +@ +countAndMarkEmptyLines :: String -> State Int String +countAndMarkEmptyLines s = runState (f s) 0 where + f = 'traverseOf' (lined . 'filtered' null) $ \\_ -> do + modify' (+ 1) + return "# Empty line" +@ + +This violates the traversal laws when newlines are set or when the source has +more than one contiguous newline anywhere. +-} +lined :: Traversal' String String +lined f = fmap (intercalate "\n") . traverse f . lines +{-# INLINE lined #-} + -- Prisms ------------------------------------------------------------------ {- $prisms-note @@ -1382,6 +1418,37 @@ _Nothing _ j = pure j {-# INLINE _Nothing #-} +{- | +'_Show' targets the Haskell value in a @String@ using 'Read', or nothing if parsing fails. Likewise, setting a Haskell value through this prism renders a @String@ using 'Show'. + +>>> ["abc","8","def","9"] & mapped . _Show %~ \x -> x + 1 :: Int +["abc","9","def","10"] + +Note that this prism is improper for types that don\'t satisfy @read . show = id@: + +>>> "25.9999999" & _Show %~ \x -> x :: Float +"26.0" + +These functions from @base@ can be expressed in terms of '_Show': + + * Unsafely parsing a value from a 'String': + + @ + 'read' = ('^?!' '_Show') + @ + + * Safely parsing a value from a 'String': + + @ + 'Text.Read.readMaybe' = ('^?' '_Show') + @ +-} +_Show :: (Show a, Read a) => Traversal' String a +_Show f s = case reads s of + [(a,"")] -> show <$> f a + _ -> pure s +{-# INLINE _Show #-} + -- Some of the guts of lens newtype Traversed a f = Traversed { getTraversed :: f a }
