Hello community, here is the log from the commit of package ghc-mmorph for openSUSE:Factory checked in at 2016-06-02 09:38:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-05-13 07:13:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-mmorph.new/ghc-mmorph.changes 2016-06-02 09:38:40.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Feb 10 20:50:53 UTC 2016 - peter.trommler@ohm-hochschule.de + +- update to 1.0.6 +* ghc 8.0 compatibility + +------------------------------------------------------------------- Old: ---- mmorph-1.0.4.tar.gz New: ---- mmorph-1.0.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-mmorph.spec ++++++ --- /var/tmp/diff_new_pack.4xokPE/_old 2016-06-02 09:38:41.000000000 +0200 +++ /var/tmp/diff_new_pack.4xokPE/_new 2016-06-02 09:38:41.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-mmorph # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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 @@ -19,7 +19,7 @@ %global pkg_name mmorph Name: ghc-mmorph -Version: 1.0.4 +Version: 1.0.6 Release: 0 Summary: Monad morphisms License: BSD-3-Clause @@ -32,6 +32,8 @@ BuildRequires: ghc-Cabal-devel BuildRequires: ghc-rpm-macros # Begin cabal-rpm deps: +BuildRequires: ghc-mtl-devel +BuildRequires: ghc-transformers-compat-devel BuildRequires: ghc-transformers-devel # End cabal-rpm deps ++++++ mmorph-1.0.4.tar.gz -> mmorph-1.0.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmorph-1.0.4/mmorph.cabal new/mmorph-1.0.6/mmorph.cabal --- old/mmorph-1.0.4/mmorph.cabal 2014-08-28 06:04:28.000000000 +0200 +++ new/mmorph-1.0.6/mmorph.cabal 2016-02-03 06:12:10.000000000 +0100 @@ -1,5 +1,5 @@ Name: mmorph -Version: 1.0.4 +Version: 1.0.6 Cabal-Version: >= 1.8.0.2 Build-Type: Simple License: BSD3 @@ -19,7 +19,9 @@ Library Hs-Source-Dirs: src Build-Depends: - base >= 4 && < 5 , - transformers >= 0.2.0.0 && < 0.5 + base >= 4 && < 5 , + mtl >= 2.0.1 && < 2.3, + transformers >= 0.2.0.0 && < 0.6, + transformers-compat >= 0.3 && < 0.6 Exposed-Modules: Control.Monad.Morph, Control.Monad.Trans.Compose GHC-Options: -O2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmorph-1.0.4/src/Control/Monad/Morph.hs new/mmorph-1.0.6/src/Control/Monad/Morph.hs --- old/mmorph-1.0.4/src/Control/Monad/Morph.hs 2014-08-28 06:04:28.000000000 +0200 +++ new/mmorph-1.0.6/src/Control/Monad/Morph.hs 2016-02-03 06:12:10.000000000 +0100 @@ -74,9 +74,7 @@ import Control.Monad.Trans.Class (MonadTrans(lift)) import qualified Control.Monad.Trans.Error as E -#if MIN_VERSION_transformers(0,4,0) -import qualified Control.Monad.Trans.Except as Ex -#endif +import qualified Control.Monad.Trans.Except as Ex import qualified Control.Monad.Trans.Identity as I import qualified Control.Monad.Trans.List as L import qualified Control.Monad.Trans.Maybe as M @@ -91,10 +89,8 @@ import Data.Functor.Compose (Compose (Compose)) import Data.Functor.Identity (runIdentity) import Data.Functor.Product (Product (Pair)) -#if MIN_VERSION_transformers(0,3,0) import Control.Applicative.Backwards (Backwards (Backwards)) import Control.Applicative.Lift (Lift (Pure, Other)) -#endif -- For documentation import Control.Exception (try, IOException) @@ -116,10 +112,8 @@ instance MFunctor (E.ErrorT e) where hoist nat m = E.ErrorT (nat (E.runErrorT m)) -#if MIN_VERSION_transformers(0,4,0) instance MFunctor (Ex.ExceptT e) where hoist nat m = Ex.ExceptT (nat (Ex.runExceptT m)) -#endif instance MFunctor I.IdentityT where hoist nat m = I.IdentityT (nat (I.runIdentityT m)) @@ -157,14 +151,12 @@ instance MFunctor (Product f) where hoist nat (Pair f g) = Pair f (nat g) -#if MIN_VERSION_transformers(0,3,0) instance MFunctor Backwards where hoist nat (Backwards f) = Backwards (nat f) instance MFunctor Lift where hoist _ (Pure a) = Pure a hoist nat (Other f) = Other (nat f) -#endif -- | A function that @generalize@s the 'Identity' base monad to be any monad. generalize :: Monad m => Identity a -> m a @@ -246,7 +238,6 @@ Right (Left e) -> Left e Right (Right a) -> Right a ) ) -#if MIN_VERSION_transformers(0,4,0) instance MMonad (Ex.ExceptT e) where embed f m = Ex.ExceptT (do x <- Ex.runExceptT (f (Ex.runExceptT m)) @@ -254,7 +245,6 @@ Left e -> Left e Right (Left e) -> Left e Right (Right a) -> Right a ) ) -#endif instance MMonad I.IdentityT where embed f m = f (I.runIdentityT m) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmorph-1.0.4/src/Control/Monad/Trans/Compose.hs new/mmorph-1.0.6/src/Control/Monad/Trans/Compose.hs --- old/mmorph-1.0.4/src/Control/Monad/Trans/Compose.hs 2014-08-28 06:04:28.000000000 +0200 +++ new/mmorph-1.0.6/src/Control/Monad/Trans/Compose.hs 2016-02-03 06:12:10.000000000 +0100 @@ -1,4 +1,8 @@ -{-# LANGUAGE FlexibleContexts, KindSignatures #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE UndecidableInstances #-} {-| Composition of monad transformers. A higher-order version of "Data.Functor.Compose". @@ -7,21 +11,31 @@ module Control.Monad.Trans.Compose ( -- * ComposeT ComposeT(ComposeT, getComposeT), + mapComposeT ) where import Control.Applicative ( Applicative(pure, (<*>), (*>), (<*)), Alternative(empty, (<|>)) ) import Control.Monad (MonadPlus(mzero, mplus), liftM) +import Control.Monad.Cont.Class (MonadCont(callCC)) +import Control.Monad.Error.Class (MonadError(throwError, catchError)) import Control.Monad.Morph (MFunctor(hoist)) +import Control.Monad.RWS.Class (MonadRWS) +import Control.Monad.Reader.Class (MonadReader(ask, local, reader)) +import Control.Monad.State.Class (MonadState(get, put, state)) import Control.Monad.Trans.Class (MonadTrans(lift)) +import Control.Monad.Writer.Class (MonadWriter(writer, tell, listen, pass)) import Control.Monad.IO.Class (MonadIO(liftIO)) import Data.Foldable (Foldable(fold, foldMap, foldr, foldl, foldr1, foldl1)) import Data.Traversable (Traversable(traverse, sequenceA, mapM, sequence)) import Prelude hiding (foldr, foldl, foldr1, foldl1, mapM, sequence) +infixr 9 `ComposeT` + -- | Composition of monad transformers. newtype ComposeT (f :: (* -> *) -> * -> *) (g :: (* -> *) -> * -> *) m a = ComposeT { getComposeT :: f (g m) a } + deriving (Eq, Ord, Read, Show) instance (MFunctor f, MonadTrans f, MonadTrans g) => MonadTrans (ComposeT f g) where @@ -65,3 +79,32 @@ sequenceA (ComposeT m) = fmap ComposeT (sequenceA m) mapM f (ComposeT m) = liftM ComposeT (mapM f m) sequence (ComposeT m) = liftM ComposeT (sequence m) + +instance MonadCont (f (g m)) => MonadCont (ComposeT f g m) where + callCC f = ComposeT $ callCC $ \c -> getComposeT (f (ComposeT . c)) + +instance MonadError e (f (g m)) => MonadError e (ComposeT f g m) where + throwError = ComposeT . throwError + catchError m h = ComposeT $ catchError (getComposeT m) (getComposeT . h) + +instance MonadRWS r w s (f (g m)) => MonadRWS r w s (ComposeT f g m) + +instance MonadReader r (f (g m)) => MonadReader r (ComposeT f g m) where + ask = ComposeT ask + local = mapComposeT . local + reader = ComposeT . reader + +instance MonadState s (f (g m)) => MonadState s (ComposeT f g m) where + get = ComposeT get + put = ComposeT . put + state = ComposeT . state + +instance MonadWriter w (f (g m)) => MonadWriter w (ComposeT f g m) where + writer = ComposeT . writer + tell = ComposeT . tell + listen = mapComposeT listen + pass = mapComposeT pass + +-- | Transform the computation inside a 'ComposeT'. +mapComposeT :: (f (g m) a -> p (q n) b) -> ComposeT f g m a -> ComposeT p q n b +mapComposeT f = ComposeT . f . getComposeT