Hello community, here is the log from the commit of package ghc-microlens-mtl for openSUSE:Factory checked in at 2017-07-05 23:59:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-microlens-mtl (Old) and /work/SRC/openSUSE:Factory/.ghc-microlens-mtl.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-microlens-mtl" Wed Jul 5 23:59:11 2017 rev:3 rq:506813 version:0.1.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-microlens-mtl/ghc-microlens-mtl.changes 2016-11-10 13:25:14.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-microlens-mtl.new/ghc-microlens-mtl.changes 2017-07-05 23:59:11.997795566 +0200 @@ -1,0 +2,5 @@ +Mon Jun 19 20:51:50 UTC 2017 - psim...@suse.com + +- Update to version 0.1.11.0. + +------------------------------------------------------------------- Old: ---- microlens-mtl-0.1.10.0.tar.gz New: ---- microlens-mtl-0.1.11.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-microlens-mtl.spec ++++++ --- /var/tmp/diff_new_pack.B45MWH/_old 2017-07-05 23:59:12.877671617 +0200 +++ /var/tmp/diff_new_pack.B45MWH/_new 2017-07-05 23:59:12.877671617 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-microlens-mtl # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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,7 +18,7 @@ %global pkg_name microlens-mtl Name: ghc-%{pkg_name} -Version: 0.1.10.0 +Version: 0.1.11.0 Release: 0 Summary: Microlens support for Reader/Writer/State from mtl License: BSD-3-Clause ++++++ microlens-mtl-0.1.10.0.tar.gz -> microlens-mtl-0.1.11.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-mtl-0.1.10.0/CHANGELOG.md new/microlens-mtl-0.1.11.0/CHANGELOG.md --- old/microlens-mtl-0.1.10.0/CHANGELOG.md 2016-08-03 11:20:21.000000000 +0200 +++ new/microlens-mtl-0.1.11.0/CHANGELOG.md 2017-06-16 16:53:48.000000000 +0200 @@ -1,3 +1,8 @@ +# 0.1.11.0 + +* Exported `Focusing`, etc. from `Lens.Micro.Mtl.Internal`. +* Added `&~`. + # 0.1.10.0 * Added `<?=` and `<.=`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-mtl-0.1.10.0/microlens-mtl.cabal new/microlens-mtl-0.1.11.0/microlens-mtl.cabal --- old/microlens-mtl-0.1.10.0/microlens-mtl.cabal 2016-08-03 11:20:21.000000000 +0200 +++ new/microlens-mtl-0.1.11.0/microlens-mtl.cabal 2017-06-16 16:53:48.000000000 +0200 @@ -1,5 +1,5 @@ name: microlens-mtl -version: 0.1.10.0 +version: 0.1.11.0 synopsis: microlens support for Reader/Writer/State from mtl description: This package contains functions (like 'view' or '+=') which work on 'MonadReader', 'MonadWriter', and 'MonadState' from the mtl package. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-mtl-0.1.10.0/src/Lens/Micro/Mtl/Internal.hs new/microlens-mtl-0.1.11.0/src/Lens/Micro/Mtl/Internal.hs --- old/microlens-mtl-0.1.10.0/src/Lens/Micro/Mtl/Internal.hs 2016-08-03 11:20:21.000000000 +0200 +++ new/microlens-mtl-0.1.11.0/src/Lens/Micro/Mtl/Internal.hs 2017-06-16 16:53:48.000000000 +0200 @@ -27,10 +27,27 @@ -} module Lens.Micro.Mtl.Internal ( + -- * Classes Zoomed, Zoom(..), Magnified, Magnify(..), + + -- * Focusing (used for 'Zoom') + Focusing(..), + FocusingWith(..), + FocusingPlus(..), + FocusingOn(..), + FocusingMay(..), + FocusingErr(..), + + -- * Effect (used for 'Magnify') + Effect(..), + EffectRWS(..), + + -- * Utilities + May(..), + Err(..), ) where @@ -309,6 +326,17 @@ return [(x', y')] ... @ + +Finally, you might need to write your own instances of 'Zoom' if you use @newtype@d transformers in your monad stack. This can be done as follows: + +@ +import "Lens.Micro.Mtl.Internal" + +type instance 'Zoomed' (MyStateT s m) = 'Zoomed' (StateT s m) + +instance Monad m =\> 'Zoom' (MyStateT s m) (MyStateT t m) s t where + 'zoom' l (MyStateT m) = MyStateT ('zoom' l m) +@ -} zoom :: LensLike' (Zoomed m c) t s -> m c -> n c @@ -424,6 +452,19 @@ path \<- 'Lens.Micro.Mtl.view' path return (protocol ++ path) @ + +This concludes the example. + +Finally, you should know writing instances of 'Magnify' for your own types can be done as follows: + +@ +import "Lens.Micro.Mtl.Internal" + +type instance 'Magnified' (MyReaderT r m) = 'Magnified' (ReaderT r m) + +instance Monad m =\> 'Magnify' (MyReaderT r m) (MyReaderT t m) r t where + 'magnify' l (MyReaderT m) = MyReaderT ('magnify' l m) +@ -} magnify :: LensLike' (Magnified m c) a b -> m c -> n c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/microlens-mtl-0.1.10.0/src/Lens/Micro/Mtl.hs new/microlens-mtl-0.1.11.0/src/Lens/Micro/Mtl.hs --- old/microlens-mtl-0.1.10.0/src/Lens/Micro/Mtl.hs 2016-08-03 11:20:21.000000000 +0200 +++ new/microlens-mtl-0.1.11.0/src/Lens/Micro/Mtl.hs 2017-06-16 16:53:48.000000000 +0200 @@ -29,6 +29,9 @@ (?=), (<~), + -- * Convenience + (&~), + -- * Specialised modifying operators -- $arith-note (+=), (-=), (*=), (//=), @@ -123,6 +126,25 @@ infix 4 <<.=, <<%=, <%=, <.=, <?= infix 4 +=, -=, *=, //= infixr 2 <~ +infixl 1 &~ + +{- | +This can be used to chain lens operations using @op=@ syntax +rather than @op~@ syntax for simple non-type-changing cases. +>>> (10,20) & _1 .~ 30 & _2 .~ 40 +(30,40) + +>>> (10,20) &~ do _1 .= 30; _2 .= 40 +(30,40) + +This does not support type-changing assignment, /e.g./ + +>>> (10,20) & _1 .~ "hello" +("hello",20) +-} +(&~) :: s -> State s a -> s +s &~ l = execState l s +{-# INLINE (&~) #-} {- | Modify state by “assigning” a value to a part of the state.