Hello community, here is the log from the commit of package ghc-mmorph for openSUSE:Factory checked in at 2016-12-06 14:25:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-mmorph (Old) and /work/SRC/openSUSE:Factory/.ghc-mmorph.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-mmorph" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-mmorph/ghc-mmorph.changes 2016-07-20 09:27:28.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-mmorph.new/ghc-mmorph.changes 2016-12-06 14:25:20.000000000 +0100 @@ -1,0 +2,5 @@ +Tue Nov 22 16:06:53 UTC 2016 - psimons@suse.com + +- Update to version 1.0.9 with cabal2obs. + +------------------------------------------------------------------- Old: ---- mmorph-1.0.6.tar.gz New: ---- mmorph-1.0.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-mmorph.spec ++++++ --- /var/tmp/diff_new_pack.4WgLuS/_old 2016-12-06 14:25:21.000000000 +0100 +++ /var/tmp/diff_new_pack.4WgLuS/_new 2016-12-06 14:25:21.000000000 +0100 @@ -18,21 +18,19 @@ %global pkg_name mmorph Name: ghc-%{pkg_name} -Version: 1.0.6 +Version: 1.0.9 Release: 0 Summary: Monad morphisms License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other 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 -# Begin cabal-rpm deps: BuildRequires: ghc-mtl-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-transformers-compat-devel BuildRequires: ghc-transformers-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -# End cabal-rpm deps %description This library provides monad morphism utilities, most commonly used for @@ -52,15 +50,12 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install - %post devel %ghc_pkg_recache ++++++ mmorph-1.0.6.tar.gz -> mmorph-1.0.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmorph-1.0.6/mmorph.cabal new/mmorph-1.0.9/mmorph.cabal --- old/mmorph-1.0.6/mmorph.cabal 2016-02-03 06:12:10.000000000 +0100 +++ new/mmorph-1.0.9/mmorph.cabal 2016-11-20 22:13:32.000000000 +0100 @@ -1,5 +1,5 @@ Name: mmorph -Version: 1.0.6 +Version: 1.0.9 Cabal-Version: >= 1.8.0.2 Build-Type: Simple License: BSD3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmorph-1.0.6/src/Control/Monad/Morph.hs new/mmorph-1.0.9/src/Control/Monad/Morph.hs --- old/mmorph-1.0.6/src/Control/Monad/Morph.hs 2016-02-03 06:12:10.000000000 +0100 +++ new/mmorph-1.0.9/src/Control/Monad/Morph.hs 2016-11-20 22:11:22.000000000 +0100 @@ -8,13 +8,13 @@
morph $ do x <- m = do x <- morph m f x morph (f x) -> +> morph (return x) = return x
... which are equivalent to the following two functor laws:
morph . (f >=> g) = morph . f >=> morph . g -> +> morph . return = return
Examples of monad morphisms include: @@ -81,7 +81,7 @@ import qualified Control.Monad.Trans.Reader as R import qualified Control.Monad.Trans.RWS.Lazy as RWS import qualified Control.Monad.Trans.RWS.Strict as RWS' -import qualified Control.Monad.Trans.State.Lazy as S +import qualified Control.Monad.Trans.State.Lazy as S import qualified Control.Monad.Trans.State.Strict as S' import qualified Control.Monad.Trans.Writer.Lazy as W' import qualified Control.Monad.Trans.Writer.Strict as W @@ -100,7 +100,7 @@ {-| A functor in the category of monads, using 'hoist' as the analog of 'fmap':
hoist (f . g) = hoist f . hoist g -> +> hoist id = id -} class MFunctor t where @@ -167,9 +167,9 @@ analog of 'return' and 'embed' as the analog of ('=<<'):
embed lift = id -> +> embed f (lift m) = f m -> +> embed g (embed f t) = embed (\m -> embed g (f m)) t -} class (MFunctor t, MonadTrans t) => MMonad t where @@ -231,7 +231,7 @@ {-# INLINABLE (|>=) #-}
instance (E.Error e) => MMonad (E.ErrorT e) where - embed f m = E.ErrorT (do + embed f m = E.ErrorT (do x <- E.runErrorT (f (E.runErrorT m)) return (case x of Left e -> Left e @@ -239,7 +239,7 @@ Right (Right a) -> Right a ) ) instance MMonad (Ex.ExceptT e) where - embed f m = Ex.ExceptT (do + embed f m = Ex.ExceptT (do x <- Ex.runExceptT (f (Ex.runExceptT m)) return (case x of Left e -> Left e @@ -286,7 +286,7 @@ Imagine that some library provided the following 'S.State' code:
import Control.Monad.Trans.State -> +> tick :: State Int () tick = modify (+1)
@@ -313,23 +313,23 @@ to be any monad:
import Data.Functor.Identity -> +> generalize :: (Monad m) => Identity a -> m a generalize m = return (runIdentity m)
... which we can 'hoist' to change @tick@'s base monad:
hoist :: (Monad m, MFunctor t) => (forall a . m a -> n a) -> t m b -> t n b -> +> hoist generalize :: (Monad m, MFunctor t) => t Identity b -> t m b -> +> hoist generalize tick :: (Monad m) => StateT Int m ()
This lets us mix @tick@ alongside 'IO' using 'lift':
import Control.Monad.Morph import Control.Monad.Trans.Class -> +> tock :: StateT Int IO () tock = do hoist generalize tick :: (Monad m) => StateT Int m () @@ -348,29 +348,29 @@ morphism laws:
generalize (return x) -> +> -- Definition of 'return' for the Identity monad = generalize (Identity x) -> +> -- Definition of 'generalize' = return (runIdentity (Identity x)) -> +> -- runIdentity (Identity x) = x = return x
generalize $ do x <- m f x -> +> -- Definition of (>>=) for the Identity monad = generalize (f (runIdentity m)) -> +> -- Definition of 'generalize' = return (runIdentity (f (runIdentity m))) -> +> -- Monad law: Left identity = do x <- return (runIdentity m) return (runIdentity (f x)) -> +> -- Definition of 'generalize' in reverse = do x <- generalize m generalize (f x) @@ -384,7 +384,7 @@ For example, we might want to combine the following @save@ function:
import Control.Monad.Trans.Writer -> +> -- i.e. :: StateT Int (WriterT [Int] Identity) () save :: StateT Int (Writer [Int]) () save = do @@ -405,7 +405,7 @@ generalizing @save@'s base monad:
import Control.Monad -> +> program :: StateT Int (WriterT [Int] IO) () program = replicateM_ 4 $ do hoist lift tock @@ -429,7 +429,7 @@ import Control.Exception import Control.Monad.Trans.Class import Control.Monad.Trans.Error -> +> check :: IO a -> ErrorT IOException IO a check io = ErrorT (try io)