Hello community, here is the log from the commit of package ghc-microlens for openSUSE:Factory checked in at 2020-11-19 11:58:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-microlens (Old) and /work/SRC/openSUSE:Factory/.ghc-microlens.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-microlens" Thu Nov 19 11:58:45 2020 rev:19 rq:849158 version:0.4.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-microlens/ghc-microlens.changes 2020-08-28 21:34:52.308709411 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-microlens.new.5913/ghc-microlens.changes 2020-11-23 10:27:36.157167542 +0100 @@ -1,0 +2,12 @@ +Tue Nov 17 15:26:52 UTC 2020 - [email protected] + +- Update microlens to version 0.4.12.0. + # 0.4.12.0 + + * Added instance `Ixed (NonEmpty a)` for GHC >= 8. + + # 0.4.11.3 + + * Exported a `coerce` compatibility shim from `Lens.Micro.Internal`. + +------------------------------------------------------------------- Old: ---- microlens-0.4.11.2.tar.gz New: ---- microlens-0.4.12.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-microlens.spec ++++++ --- /var/tmp/diff_new_pack.s73YgN/_old 2020-11-23 10:27:36.761168225 +0100 +++ /var/tmp/diff_new_pack.s73YgN/_new 2020-11-23 10:27:36.761168225 +0100 @@ -18,7 +18,7 @@ %global pkg_name microlens Name: ghc-%{pkg_name} -Version: 0.4.11.2 +Version: 0.4.12.0 Release: 0 Summary: A tiny lens library with no dependencies License: BSD-3-Clause ++++++ microlens-0.4.11.2.tar.gz -> microlens-0.4.12.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.11.2/CHANGELOG.md new/microlens-0.4.12.0/CHANGELOG.md --- old/microlens-0.4.11.2/CHANGELOG.md 2019-07-05 23:38:34.000000000 +0200 +++ new/microlens-0.4.12.0/CHANGELOG.md 2020-11-17 07:42:12.000000000 +0100 @@ -1,3 +1,11 @@ +# 0.4.12.0 + +* Added instance `Ixed (NonEmpty a)` for GHC >= 8. + +# 0.4.11.3 + +* Exported a `coerce` compatibility shim from `Lens.Micro.Internal`. + # 0.4.11.2 * Fixed compilation on GHC 8.8 (thanks to @vmchale). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.11.2/microlens.cabal new/microlens-0.4.12.0/microlens.cabal --- old/microlens-0.4.11.2/microlens.cabal 2019-07-05 23:38:34.000000000 +0200 +++ new/microlens-0.4.12.0/microlens.cabal 2020-11-17 07:42:12.000000000 +0100 @@ -1,5 +1,5 @@ name: microlens -version: 0.4.11.2 +version: 0.4.12.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!). @@ -48,7 +48,9 @@ GHC==8.0.2 GHC==8.2.2 GHC==8.4.4 - GHC==8.6.4 + GHC==8.6.5 + GHC==8.8.1 + GHC==8.10.1 source-repository head type: git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.11.2/src/Lens/Micro/Internal.hs new/microlens-0.4.12.0/src/Lens/Micro/Internal.hs --- old/microlens-0.4.11.2/src/Lens/Micro/Internal.hs 2019-07-05 22:48:32.000000000 +0200 +++ new/microlens-0.4.12.0/src/Lens/Micro/Internal.hs 2020-11-17 07:42:12.000000000 +0100 @@ -11,7 +11,7 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ImplicitParams #-} --- 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. +-- Note: this module is marked 'Unsafe' because it exports '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 #-} {- | @@ -36,8 +36,6 @@ foldrOf, foldMapOf, sets, - ( #. ), - ( .# ), phantom, Each(..), Index, @@ -56,6 +54,13 @@ -- * CallStack HasCallStack, + + -- * Coerce compatibility shim + coerce, + + -- * Coerce-like composition + ( #. ), + ( .# ), ) where @@ -69,7 +74,7 @@ import Data.Complex #if __GLASGOW_HASKELL__ >= 800 -import Data.List.NonEmpty (NonEmpty) +import Data.List.NonEmpty (NonEmpty(..)) #endif #if __GLASGOW_HASKELL__ < 710 @@ -154,34 +159,6 @@ {-# INLINE noEffect #-} ------------------------------------------------------------------------------ --- 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 - -( .# ) :: Coercible b a => (b -> c) -> (a -> b) -> (a -> c) -( .# ) pbc _ = coerce pbc -#else -( #. ) :: (b -> c) -> (a -> b) -> (a -> c) -( #. ) _ = unsafeCoerce - -( .# ) :: (b -> c) -> (a -> b) -> (a -> c) -( .# ) pbc _ = unsafeCoerce pbc -#endif - -{-# INLINE ( #. ) #-} -{-# INLINE ( .# ) #-} - -infixr 9 #. -infixl 8 .# - ------------------------------------------------------------------------------- -- classes ------------------------------------------------------------------------------ @@ -270,6 +247,11 @@ type instance Index [a] = Int type instance IxValue [a] = a +#if __GLASGOW_HASKELL__ >= 800 +type instance Index (NonEmpty a) = Int +type instance IxValue (NonEmpty a) = a +#endif + class Ixed m where {- | This traversal lets you access (and update) an arbitrary element in a list, array, @Map@, etc. (If you want to insert or delete elements as well, look at 'at'.) @@ -297,11 +279,21 @@ The following instances are provided in this package: +#if __GLASGOW_HASKELL__ >= 800 @ 'ix' :: 'Int' -> 'Traversal'' [a] a +'ix' :: 'Int' -> 'Traversal'' (NonEmpty a) a + 'ix' :: ('Eq' e) => e -> 'Traversal'' (e -> a) a @ +#else +@ +'ix' :: 'Int' -> 'Traversal'' [a] a + +'ix' :: ('Eq' e) => e -> 'Traversal'' (e -> a) a +@ +#endif You can also use 'ix' with types from <http://hackage.haskell.org/package/array array>, <http://hackage.haskell.org/package/bytestring bytestring>, and <http://hackage.haskell.org/package/containers containers> by using <http://hackage.haskell.org/package/microlens-ghc microlens-ghc>, or additionally with types from <http://hackage.haskell.org/package/vector vector>, <http://hackage.haskell.org/package/text text>, and <http://hackage.haskell.org/package/unordered-containers unordered-containers> by using <http://hackage.haskell.org/package/microlens-platform microlens-platform>. -} @@ -360,6 +352,15 @@ go (a:as) i = (a:) <$> (go as $! i - 1) {-# INLINE ix #-} +#if __GLASGOW_HASKELL__ >= 800 +instance Ixed (NonEmpty a) where + ix k f xs0 | k < 0 = pure xs0 + | otherwise = go xs0 k where + go (a:|as) 0 = (:|as) <$> f a + go (a:|as) i = (a:|) <$> ix (i - 1) f as + {-# INLINE ix #-} +#endif + class Field1 s t a b | s -> a, t -> b, s b -> t, t a -> s where {- | Gives access to the 1st field of a tuple (up to 5-tuples). @@ -618,3 +619,41 @@ "hello" :: Lazy.Text -} lazy :: Lens' strict lazy + +---------------------------------------------------------------------------- +-- Coerce compatibility shim +---------------------------------------------------------------------------- + +#if __GLASGOW_HASKELL__ < 708 +coerce :: a -> b +coerce = unsafeCoerce +{-# INLINE coerce #-} +#endif + +---------------------------------------------------------------------------- +-- Coerce-like composition +---------------------------------------------------------------------------- + +-- 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 + +( .# ) :: Coercible b a => (b -> c) -> (a -> b) -> (a -> c) +( .# ) pbc _ = coerce pbc +#else +( #. ) :: (b -> c) -> (a -> b) -> (a -> c) +( #. ) _ = unsafeCoerce + +( .# ) :: (b -> c) -> (a -> b) -> (a -> c) +( .# ) pbc _ = unsafeCoerce pbc +#endif + +{-# INLINE ( #. ) #-} +{-# INLINE ( .# ) #-} + +infixr 9 #. +infixl 8 .# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-0.4.11.2/src/Lens/Micro.hs new/microlens-0.4.12.0/src/Lens/Micro.hs --- old/microlens-0.4.11.2/src/Lens/Micro.hs 2019-07-05 23:38:34.000000000 +0200 +++ new/microlens-0.4.12.0/src/Lens/Micro.hs 2020-01-29 01:56:21.000000000 +0100 @@ -116,12 +116,6 @@ 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 ((&)) #endif @@ -1059,13 +1053,8 @@ 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,[]) _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
