Hello community, here is the log from the commit of package ghc-microlens for openSUSE:Leap:15.2 checked in at 2020-02-19 18:40:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/ghc-microlens (Old) and /work/SRC/openSUSE:Leap:15.2/.ghc-microlens.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-microlens" Wed Feb 19 18:40:00 2020 rev:11 rq:771375 version:0.4.11.2 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/ghc-microlens/ghc-microlens.changes 2020-01-15 15:02:19.533806985 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.ghc-microlens.new.26092/ghc-microlens.changes 2020-02-19 18:40:01.462102890 +0100 @@ -1,0 +2,35 @@ +Wed Jan 1 11:21:47 UTC 2020 - Peter Simons <[email protected]> + +- Extend the %description. + +------------------------------------------------------------------- +Fri Nov 8 16:14:12 UTC 2019 - Peter Simons <[email protected]> + +- Drop obsolete group attributes. + +------------------------------------------------------------------- +Sat Jul 6 02:02:21 UTC 2019 - [email protected] + +- Update microlens to version 0.4.11.2. + # 0.4.11.2 + + * Fixed compilation on GHC 8.8 (thanks to @vmchale). + +------------------------------------------------------------------- +Fri Jun 21 02:02:59 UTC 2019 - [email protected] + +- Update microlens to version 0.4.11.1. + # 0.4.11.1 + + * Reverted marking `Lens.Micro.Internal` as `Trustworthy`, see [#122](https://github.com/monadfix/microlens/issues/122). + +------------------------------------------------------------------- +Wed Jun 19 11:46:02 UTC 2019 - [email protected] + +- Update microlens to version 0.4.11. + 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/microlens-0.4.11/src/CHANGELOG.md + +------------------------------------------------------------------- Old: ---- microlens-0.4.10.tar.gz New: ---- microlens-0.4.11.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-microlens.spec ++++++ --- /var/tmp/diff_new_pack.Du8myK/_old 2020-02-19 18:40:01.946103485 +0100 +++ /var/tmp/diff_new_pack.Du8myK/_new 2020-02-19 18:40:01.946103485 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-microlens # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,31 +18,28 @@ %global pkg_name microlens Name: ghc-%{pkg_name} -Version: 0.4.10 +Version: 0.4.11.2 Release: 0 -Summary: Tiny lens library for Haskell +Summary: A tiny lens library with no dependencies License: BSD-3-Clause -Group: Development/Libraries/Haskell URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel BuildRequires: ghc-rpm-macros %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!). - This library is an extract from <http://hackage.haskell.org/package/lens lens> (with no dependencies). It's not a toy lenses library, unsuitable for “real world”, but merely a small one. It is compatible with lens, and should have same performance. It also has better documentation. +There's a longer readme <https://github.com/monadfix/microlens#readme on +Github>. It has a migration guide for lens users, a description of other +packages in the family, a discussion of other lens libraries you could use +instead, and so on. + %package devel Summary: Haskell %{pkg_name} library development files -Group: Development/Libraries/Haskell Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} ++++++ microlens-0.4.10.tar.gz -> microlens-0.4.11.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.10/CHANGELOG.md new/microlens-0.4.11.2/CHANGELOG.md --- old/microlens-0.4.10/CHANGELOG.md 2018-11-03 12:53:50.000000000 +0100 +++ new/microlens-0.4.11.2/CHANGELOG.md 2019-07-05 23:38:34.000000000 +0200 @@ -1,3 +1,18 @@ +# 0.4.11.2 + +* Fixed compilation on GHC 8.8 (thanks to @vmchale). + +# 0.4.11.1 + +* Reverted marking `Lens.Micro.Internal` as `Trustworthy`, see [#122](https://github.com/monadfix/microlens/issues/122). + +# 0.4.11 + +* Added fixity declarations for `+~` and `-~` (thanks to Francesco Ariis). +* Added `rewriteOf` and `transformOf` (thanks to @quasicomputational). +* Added an instance `Each (Either a a) (Either b b) a b`, following `lens`'s suit. +* Marked `Lens.Micro.Internal` as `Trustworthy` starting from GHC 7.8. + # 0.4.10 * Added `+~` and `-~`. @@ -95,7 +110,7 @@ # 0.3.4.1 -* Changed the description of the package from “A tiny part of the lens library which you can depend upon” to “A tiny part of the lens library with no dependencies” because the previous one was ambiguous (I admit I kinda liked that ambiguity, tho). +* Changed the description of the package from “A tiny part of the lens library which you can depend upon” to “A tiny part of the lens library with no dependencies” because the previous one was ambiguous (I admit I kinda liked that ambiguity, though). # 0.3.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.10/microlens.cabal new/microlens-0.4.11.2/microlens.cabal --- old/microlens-0.4.10/microlens.cabal 2018-11-03 12:54:15.000000000 +0100 +++ new/microlens-0.4.11.2/microlens.cabal 2019-07-05 23:38:34.000000000 +0200 @@ -1,6 +1,6 @@ name: microlens -version: 0.4.10 -synopsis: A tiny lens library with no dependencies. If you're writing an app, you probably want microlens-platform, not this. +version: 0.4.11.2 +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!). . @@ -18,7 +18,7 @@ . However, don't use this library if: . - * You need @Iso@s, @Prism@s, indexed traversals, or actually anything else which isn't defined here (tho some indexed functions are available elsewhere – containers and vector provide them for their types, and <http://hackage.haskell.org/package/ilist ilist> provides indexed functions for lists). + * You need @Iso@s, @Prism@s, indexed traversals, or actually anything else which isn't defined here (though some indexed functions are available elsewhere – containers and vector provide them for their types, and <http://hackage.haskell.org/package/ilist ilist> provides indexed functions for lists). . * You want a library with a clean, understandable implementation (in which case you're looking for <http://hackage.haskell.org/package/lens-simple lens-simple>). . @@ -32,7 +32,7 @@ license: BSD3 license-file: LICENSE author: Edward Kmett, Artyom Kazak -maintainer: Monadfix <[email protected]> +maintainer: Monadfix <[email protected]> homepage: http://github.com/monadfix/microlens bug-reports: http://github.com/monadfix/microlens/issues -- copyright: @@ -41,6 +41,14 @@ extra-source-files: CHANGELOG.md cabal-version: >=1.10 +tested-with: GHC==7.4.2 + 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.4 source-repository head type: git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.10/src/Lens/Micro/Internal.hs new/microlens-0.4.11.2/src/Lens/Micro/Internal.hs --- old/microlens-0.4.10/src/Lens/Micro/Internal.hs 2018-11-03 12:52:00.000000000 +0100 +++ new/microlens-0.4.11.2/src/Lens/Micro/Internal.hs 2019-07-05 22:48:32.000000000 +0200 @@ -10,8 +10,9 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ImplicitParams #-} -{-# LANGUAGE Unsafe #-} +-- Note: this module is marked 'Unsafe' because it exports (#.), which is essentially 'coerce', and Data.Coerce is marked 'Unsafe' in base. As per <https://github.com/ekmett/lens/issues/661>, this is an issue for 'lens' as well but they have opted for 'Trustworthy' instead. +{-# LANGUAGE Unsafe #-} {- | Module : Lens.Micro.Internal @@ -156,6 +157,10 @@ -- Data.Profunctor.Unsafe ------------------------------------------------------------------------------ +-- Note: 'lens' defines a type-restricted version of (#.) to work around a +-- bug, but our version is restricted enough that we don't need it. See +-- <https://github.com/ekmett/lens/commit/cde2fc39c0dba413d1a6f814b47bd14431a5e339> + #if __GLASGOW_HASKELL__ >= 708 ( #. ) :: Coercible c b => (b -> c) -> (a -> b) -> (a -> c) ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b @@ -198,6 +203,7 @@ 'each' :: 'Traversal' [a] [b] a b 'each' :: 'Traversal' ('Maybe' a) ('Maybe' b) a b +'each' :: 'Traversal' ('Either' a a) ('Either' b b) a b -- since 0.4.11 'each' :: 'Traversal' (a,a) (b,b) a b 'each' :: 'Traversal' (a,a,a) (b,b,b) a b @@ -239,12 +245,22 @@ each = traverse {-# INLINE each #-} +{- | +@since 0.4.11 +-} +instance (a~a', b~b') => Each (Either a a') (Either b b') a b where + each f (Left a) = Left <$> f a + each f (Right a ) = Right <$> f a + {-# INLINE each #-} + #if __GLASGOW_HASKELL__ >= 800 instance Each (NonEmpty a) (NonEmpty b) a b where each = traversed {-# INLINE each #-} #endif +-- NOTE: when adding new instances of 'Each', update the docs for 'each'. + type family Index (s :: *) :: * type family IxValue (m :: *) :: * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.10/src/Lens/Micro.hs new/microlens-0.4.11.2/src/Lens/Micro.hs --- old/microlens-0.4.10/src/Lens/Micro.hs 2018-11-03 12:51:53.000000000 +0100 +++ new/microlens-0.4.11.2/src/Lens/Micro.hs 2019-07-05 23:38:34.000000000 +0200 @@ -25,6 +25,7 @@ Unofficial: * <http://hackage.haskell.org/package/microlens-aeson microlens-aeson> – a port of <http://hackage.haskell.org/package/lens-aeson lens-aeson> +* <http://hackage.haskell.org/package/microlens-process microlens-process> - a port of <http://hackage.haskell.org/package/lens-process lens-process> -} module Lens.Micro @@ -44,6 +45,8 @@ (?~), (<%~), (<<%~), (<<.~), mapped, + rewriteOf, + transformOf, -- * Getter: extracts a value from a structure -- $getters-note @@ -112,7 +115,12 @@ import Data.Maybe import Data.Tuple import qualified Data.Foldable as F + +#if __GLASGOW_HASKELL__ >= 708 +import Data.Coerce +#else import Unsafe.Coerce +#endif #if MIN_VERSION_base(4,8,0) import Data.Function ((&)) @@ -304,57 +312,69 @@ {-# INLINE over #-} --- | Increment the target(s) of a numerically valued 'Lens' or 'Traversal'. --- --- >>> (a,b) & _1 +~ c --- (a + c,b) --- --- >>> (a,b) & both +~ c --- (a + c,b + c) --- --- >>> (1,2) & _2 +~ 1 --- (1,3) --- --- >>> [(a,b),(c,d)] & traverse.both +~ e --- [(a + e,b + e),(c + e,d + e)] --- --- @ --- ('+~') :: 'Num' a => 'Lens'' s a -> a -> s -> s --- ('+~') :: 'Num' a => 'Traversal'' s a -> a -> s -> s --- @ +{- | +Increment the target(s) of a numerically valued 'Lens' or 'Traversal'. + +>>> (a,b) & _1 +~ c +(a + c,b) + +>>> (a,b) & both +~ c +(a + c,b + c) + +>>> (1,2) & _2 +~ 1 +(1,3) + +>>> [(a,b),(c,d)] & traverse.both +~ e +[(a + e,b + e),(c + e,d + e)] + +@ +('+~') :: 'Num' a => 'Lens'' s a -> a -> s -> s +('+~') :: 'Num' a => 'Traversal'' s a -> a -> s -> s +@ + +@since 0.4.10 +-} (+~) :: Num a => ASetter s t a a -> a -> s -> t l +~ n = over l (+ n) {-# INLINE (+~) #-} --- | Decrement the target(s) of a numerically valued 'Lens', or 'Traversal'. --- --- >>> (a,b) & _1 -~ c --- (a - c,b) --- --- >>> (a,b) & both -~ c --- (a - c,b - c) --- --- >>> _1 -~ 2 $ (1,2) --- (-1,2) --- --- >>> mapped.mapped -~ 1 $ [[4,5],[6,7]] --- [[3,4],[5,6]] --- --- @ --- ('-~') :: 'Num' a => 'Lens'' s a -> a -> s -> s --- ('-~') :: 'Num' a => 'Traversal'' s a -> a -> s -> s --- @ +infixr 4 +~ + +{- | +Decrement the target(s) of a numerically valued 'Lens', or 'Traversal'. + +>>> (a,b) & _1 -~ c +(a - c,b) + +>>> (a,b) & both -~ c +(a - c,b - c) + +>>> _1 -~ 2 $ (1,2) +(-1,2) + +>>> mapped.mapped -~ 1 $ [[4,5],[6,7]] +[[3,4],[5,6]] + +@ +('-~') :: 'Num' a => 'Lens'' s a -> a -> s -> s +('-~') :: 'Num' a => 'Traversal'' s a -> a -> s -> s +@ + +@since 0.4.10 +-} (-~) :: Num a => ASetter s t a a -> a -> s -> t l -~ n = over l (subtract n) {-# INLINE (-~) #-} - +infixr 4 -~ {- | ('<>~') appends a value monoidally to the target. >>> ("hello", "goodbye") & both <>~ " world!" ("hello world!", "goodbye world!") + +@since 0.4.9 -} (<>~) :: (Monoid a) => ASetter s t a a -> a -> s -> t (<>~) l a = over l (`mappend` a) @@ -498,6 +518,30 @@ infixr 4 <<.~ +{- | +→ See <https://github.com/monadfix/microlens/pull/119#issuecomment-496004851 an example> on GitHub. + +Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result. + +Usually 'transformOf' is more appropriate, but 'rewriteOf' can give better compositionality. Given two single transformations @f@ and @g@, you can construct @\\a -> f a '<|>' g a@ which performs both rewrites until a fixed point. + +@since 0.4.11 +-} +rewriteOf :: ASetter a b a b -> (b -> Maybe a) -> a -> b +rewriteOf l f = go where + go = transformOf l (\x -> maybe x go (f x)) +{-# INLINE rewriteOf #-} + +{- | +Transform every element by recursively applying a given 'ASetter' in a bottom-up manner. + +@since 0.4.11 +-} +transformOf :: ASetter a b a b -> (b -> b) -> a -> b +transformOf l f = go where + go = f . over l go +{-# INLINE transformOf #-} + -- Getting ----------------------------------------------------------------- {- $getters-note @@ -1015,8 +1059,13 @@ where Bazaar b = l sell s sell w = Bazaar ($ w) +#if __GLASGOW_HASKELL__ >= 708 + ins f = (coerce :: [Identity a] -> [a]) + (getConst (f (\ra -> Const [Identity ra]))) +#else ins f = (unsafeCoerce :: [Identity a] -> [a]) (getConst (f (\ra -> Const [Identity ra]))) +#endif unsafeOuts f = evalState (f (\_ -> state (unconsWithDefault fakeVal))) where fakeVal = error "unsafeOuts: not enough elements were supplied" unconsWithDefault d [] = (d,[]) @@ -1413,8 +1462,10 @@ ~(a, s') <- runStateT m s runStateT (k a) s' {-# INLINE (>>=) #-} +#if !MIN_VERSION_base(4,13,0) fail str = StateT $ \ _ -> fail str {-# INLINE fail #-} +#endif #if MIN_VERSION_base(4,9,0) instance (Fail.MonadFail m) => Fail.MonadFail (StateT s m) where
