packages feed

comonads-fd 1.7 → 1.8.0

raw patch · 9 files changed

+2/−295 lines, 9 filesdep ~comonad-transformersPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: comonad-transformers

API changes (from Hackage documentation)

- Control.Comonad.Cofree: (:<) :: a -> f (Cofree f a) -> Cofree a
- Control.Comonad.Cofree: class (Functor f, Comonad w) => ComonadCofree f w | w -> f
- Control.Comonad.Cofree: coiter :: Functor f => (a -> f a) -> a -> Cofree f a
- Control.Comonad.Cofree: data Cofree f :: (* -> *) a :: (* -> *) -> * -> *
- Control.Comonad.Cofree: section :: Comonad f => f a -> Cofree f a
- Control.Comonad.Cofree: unfold :: Functor f => (b -> (a, f b)) -> b -> Cofree f a
- Control.Comonad.Cofree: unwrap :: ComonadCofree f w => w a -> f (w a)
- Control.Comonad.Cofree.Class: class (Functor f, Comonad w) => ComonadCofree f w | w -> f
- Control.Comonad.Cofree.Class: instance (ComonadCofree f w, Semigroup m, Monoid m) => ComonadCofree f (TracedT m w)
- Control.Comonad.Cofree.Class: instance ComonadCofree f w => ComonadCofree f (DiscontT k w)
- Control.Comonad.Cofree.Class: instance ComonadCofree f w => ComonadCofree f (EnvT e w)
- Control.Comonad.Cofree.Class: instance ComonadCofree f w => ComonadCofree f (IdentityT w)
- Control.Comonad.Cofree.Class: instance ComonadCofree f w => ComonadCofree f (StoreT s w)
- Control.Comonad.Cofree.Class: instance Functor f => ComonadCofree f (Cofree f)
- Control.Comonad.Cofree.Class: unwrap :: ComonadCofree f w => w a -> f (w a)
- Control.Comonad.Env.Class: instance ComonadEnv e w => ComonadEnv e (Cofree w)
- Control.Comonad.Store.Class: instance ComonadStore s w => ComonadStore s (Cofree w)
- Control.Comonad.Traced.Class: instance ComonadTraced m w => ComonadTraced m (Cofree w)
- Control.Monad.Free: Free :: f (Free f a) -> Free a
- Control.Monad.Free: Pure :: a -> Free a
- Control.Monad.Free: class (Functor f, Monad m) => MonadFree f m | m -> f
- Control.Monad.Free: data Free f :: (* -> *) a :: (* -> *) -> * -> *
- Control.Monad.Free: iter :: Functor f => (f a -> a) -> Free f a -> a
- Control.Monad.Free: retract :: Monad f => Free f a -> f a
- Control.Monad.Free: wrap :: MonadFree f m => f (m a) -> m a
- Control.Monad.Free.Class: class (Functor f, Monad m) => MonadFree f m | m -> f
- Control.Monad.Free.Class: instance (MonadFree f m, Error e) => MonadFree f (ErrorT e m)
- Control.Monad.Free.Class: instance (MonadFree f m, Monoid w) => MonadFree f (RWST r w s m)
- Control.Monad.Free.Class: instance (MonadFree f m, Monoid w) => MonadFree f (WriterT w m)
- Control.Monad.Free.Class: instance Functor f => MonadFree f (Free f)
- Control.Monad.Free.Class: instance MonadFree f m => MonadFree f (IdentityT m)
- Control.Monad.Free.Class: instance MonadFree f m => MonadFree f (ListT m)
- Control.Monad.Free.Class: instance MonadFree f m => MonadFree f (MaybeT m)
- Control.Monad.Free.Class: instance MonadFree f m => MonadFree f (ReaderT e m)
- Control.Monad.Free.Class: instance MonadFree f m => MonadFree f (StateT s m)
- Control.Monad.Free.Class: wrap :: MonadFree f m => f (m a) -> m a
- Data.Lens: (!%%=) :: MonadState a m => Lens a b -> (b -> (c, b)) -> m c
- Data.Lens: (!%=) :: MonadState a m => Lens a b -> (b -> b) -> m b
- Data.Lens: (!&&=) :: MonadState a m => Lens a Bool -> Bool -> m Bool
- Data.Lens: (!*=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (!+=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (!-=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (!/=) :: (MonadState a m, Fractional b) => Lens a b -> b -> m b
- Data.Lens: (!=) :: MonadState a m => Lens a b -> b -> m b
- Data.Lens: (!||=) :: MonadState a m => Lens a Bool -> Bool -> m Bool
- Data.Lens: (%%=) :: MonadState a m => Lens a b -> (b -> (c, b)) -> m c
- Data.Lens: (%=) :: MonadState a m => Lens a b -> (b -> b) -> m b
- Data.Lens: (&&=) :: MonadState a m => Lens a Bool -> Bool -> m Bool
- Data.Lens: (*=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (+=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (-=) :: (MonadState a m, Num b) => Lens a b -> b -> m b
- Data.Lens: (//=) :: (MonadState a m, Fractional b) => Lens a b -> b -> m b
- Data.Lens: (||=) :: MonadState a m => Lens a Bool -> Bool -> m Bool
- Data.Lens: (~=) :: MonadState a m => Lens a b -> b -> m b
- Data.Lens: access :: MonadState a m => Lens a b -> m b

Files

− Control/Comonad/Cofree.hs
@@ -1,20 +0,0 @@--------------------------------------------------------------------------------- |--- Module      :  Control.Comonad.Cofree--- Copyright   :  (C) 2008-2011 Edward Kmett--- License     :  BSD-style (see the file LICENSE)------ Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  experimental--- Portability :  non-portable (fundeps, MPTCs)------------------------------------------------------------------------------module Control.Comonad.Cofree -  ( ComonadCofree(..)-  , Cofree(..)-  , coiter-  , unfold-  , section-  ) where--import Control.Comonad.Cofree.Class-import Control.Comonad.Trans.Cofree
− Control/Comonad/Cofree/Class.hs
@@ -1,74 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}--------------------------------------------------------------------------------- |--- Module      :  Control.Comonad.Cofree.Class--- Copyright   :  (C) 2008-2011 Edward Kmett--- License     :  BSD-style (see the file LICENSE)------ Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  experimental--- Portability :  non-portable (fundeps, MPTCs)------------------------------------------------------------------------------module Control.Comonad.Cofree.Class -  ( ComonadCofree(..)-  ) where--import Control.Applicative-import Control.Comonad-import Control.Comonad.Trans.Cofree (Cofree(..))-import qualified Control.Comonad.Trans.Cofree as Cofree--- import Control.Comonad.Trans.Class-import qualified Control.Comonad.Trans.Env.Strict as Strict-import qualified Control.Comonad.Trans.Store.Strict as Strict-import qualified Control.Comonad.Trans.Discont.Strict as Strict-import qualified Control.Comonad.Trans.Env.Lazy as Lazy-import qualified Control.Comonad.Trans.Store.Lazy as Lazy-import qualified Control.Comonad.Trans.Discont.Lazy as Lazy-import qualified Control.Comonad.Trans.Traced as Simple-import qualified Control.Comonad.Trans.Traced.Memo as Memo-import qualified Control.Comonad.Trans.Store.Memo as Memo-import qualified Control.Comonad.Trans.Discont.Memo as Memo-import Control.Comonad.Trans.Identity -import Data.Monoid-import Data.Semigroup--class (Functor f, Comonad w) => ComonadCofree f w | w -> f where-  unwrap :: w a -> f (w a)--instance Functor f => ComonadCofree f (Cofree f) where-  unwrap = Cofree.unwrap--instance ComonadCofree f w => ComonadCofree f (IdentityT w) where-  unwrap = fmap IdentityT . unwrap . runIdentityT-  -instance ComonadCofree f w => ComonadCofree f (Strict.EnvT e w) where-  unwrap (Strict.EnvT e wa) = Strict.EnvT e <$> unwrap wa--instance ComonadCofree f w => ComonadCofree f (Lazy.EnvT e w) where-  unwrap (Lazy.EnvT e wa) = Lazy.EnvT e <$> unwrap wa--instance ComonadCofree f w => ComonadCofree f (Strict.StoreT s w) where-  unwrap (Strict.StoreT wsa s) = flip Strict.StoreT s <$> unwrap wsa--instance ComonadCofree f w => ComonadCofree f (Lazy.StoreT s w) where-  unwrap (Lazy.StoreT wsa s) = flip Lazy.StoreT s <$> unwrap wsa--instance ComonadCofree f w => ComonadCofree f (Memo.StoreT s w) where-  unwrap w = flip Memo.storeT s <$> unwrap wsa-    where (wsa, s) = Memo.runStoreT w--instance (ComonadCofree f w, Semigroup m, Monoid m) => ComonadCofree f (Simple.TracedT m w) where-  unwrap (Simple.TracedT wma) = Simple.TracedT <$> unwrap wma--instance (ComonadCofree f w, Semigroup m, Monoid m) => ComonadCofree f (Memo.TracedT m w) where-  unwrap = fmap Memo.tracedT . unwrap . Memo.runTracedT--instance ComonadCofree f w => ComonadCofree f (Strict.DiscontT k w) where-  unwrap (Strict.DiscontT f ws) = Strict.DiscontT f <$> unwrap ws--instance ComonadCofree f w => ComonadCofree f (Lazy.DiscontT k w) where-  unwrap (Lazy.DiscontT f ws) = Lazy.DiscontT f <$> unwrap ws--instance ComonadCofree f w => ComonadCofree f (Memo.DiscontT k w) where-  unwrap w = Memo.discontT f <$> unwrap wa-    where (f, wa) = Memo.runDiscontT w
Control/Comonad/Env/Class.hs view
@@ -16,7 +16,6 @@  import Control.Comonad import Control.Comonad.Trans.Class-import Control.Comonad.Trans.Cofree import qualified Control.Comonad.Trans.Env.Lazy as Lazy import qualified Control.Comonad.Trans.Store.Lazy as Lazy import qualified Control.Comonad.Trans.Discont.Lazy as Lazy@@ -84,5 +83,3 @@ instance (ComonadEnv e w, Monoid m) => ComonadEnv e (Memo.TracedT m w) where   ask = lowerAsk -instance ComonadEnv e w => ComonadEnv e (Cofree w) where-  ask = lowerAsk 
Control/Comonad/Store/Class.hs view
@@ -30,7 +30,6 @@ import qualified Control.Comonad.Trans.Traced.Memo as Memo import qualified Control.Comonad.Trans.Store.Memo as Memo import qualified Control.Comonad.Trans.Discont.Memo as Memo-import Control.Comonad.Trans.Cofree import Control.Comonad.Trans.Identity  import Data.Monoid import Data.Semigroup@@ -47,10 +46,6 @@        seeks :: (s -> s) -> w a -> w a   seeks f = peeks f . duplicate--instance ComonadStore s w => ComonadStore s (Cofree w) where-  pos (_ :< as) = pos as-  peek s (_ :< as) = extract (peek s as)  instance Comonad w => ComonadStore s (Strict.StoreT s w) where   pos = Strict.pos
Control/Comonad/Traced/Class.hs view
@@ -16,7 +16,6 @@  import Control.Comonad import Control.Comonad.Trans.Class-import Control.Comonad.Trans.Cofree import qualified Control.Comonad.Trans.Env.Strict as Strict import qualified Control.Comonad.Trans.Store.Strict as Strict import qualified Control.Comonad.Trans.Discont.Strict as Strict@@ -77,5 +76,3 @@ instance ComonadTraced m w => ComonadTraced m (Memo.StoreT s w) where   trace = lowerTrace -instance ComonadTraced m w => ComonadTraced m (Cofree w) where-  trace = lowerTrace
− Control/Monad/Free.hs
@@ -1,19 +0,0 @@--------------------------------------------------------------------------------- |--- Module      :  Control.Monad.Free--- Copyright   :  (C) 2008-2011 Edward Kmett--- License     :  BSD-style (see the file LICENSE)------ Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  experimental--- Portability :  non-portable (fundeps, MPTCs)------------------------------------------------------------------------------module Control.Monad.Free -  ( MonadFree(..)-  , Free(..)-  , iter-  , retract-  ) where--import Control.Monad.Free.Class-import Control.Monad.Trans.Free
− Control/Monad/Free/Class.hs
@@ -1,69 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}--------------------------------------------------------------------------------- |--- Module      :  Control.Monad.Free.Class--- Copyright   :  (C) 2008-2011 Edward Kmett--- License     :  BSD-style (see the file LICENSE)------ Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  experimental--- Portability :  non-portable (fundeps, MPTCs)------------------------------------------------------------------------------module Control.Monad.Free.Class -  ( MonadFree(..)-  ) where--import Control.Applicative-import Control.Monad.Trans.Free (Free(..))-import Control.Monad.Trans.Reader-import qualified Control.Monad.Trans.State.Strict as Strict-import qualified Control.Monad.Trans.State.Lazy as Lazy-import qualified Control.Monad.Trans.Writer.Strict as Strict-import qualified Control.Monad.Trans.Writer.Lazy as Lazy-import qualified Control.Monad.Trans.RWS.Strict as Strict-import qualified Control.Monad.Trans.RWS.Lazy as Lazy-import Control.Monad.Trans.Maybe-import Control.Monad.Trans.List-import Control.Monad.Trans.Error-import Control.Monad.Trans.Identity -import Data.Monoid--class (Functor f, Monad m) => MonadFree f m | m -> f where-  wrap :: f (m a) -> m a--instance Functor f => MonadFree f (Free f) where-  wrap = Free--instance MonadFree f m => MonadFree f (ReaderT e m) where-  wrap fm = ReaderT $ \e -> wrap $ flip runReaderT e <$> fm--instance MonadFree f m => MonadFree f (Lazy.StateT s m) where-  wrap fm = Lazy.StateT $ \s -> wrap $ flip Lazy.runStateT s <$> fm--instance MonadFree f m => MonadFree f (Strict.StateT s m) where-  wrap fm = Strict.StateT $ \s -> wrap $ flip Strict.runStateT s <$> fm--instance (MonadFree f m, Monoid w) => MonadFree f (Lazy.WriterT w m) where-  wrap = Lazy.WriterT . wrap . fmap Lazy.runWriterT--instance (MonadFree f m, Monoid w) => MonadFree f (Strict.WriterT w m) where-  wrap = Strict.WriterT . wrap . fmap Strict.runWriterT--instance (MonadFree f m, Monoid w) => MonadFree f (Strict.RWST r w s m) where-  wrap fm = Strict.RWST $ \r s -> wrap $ fmap (\m -> Strict.runRWST m r s) fm--instance (MonadFree f m, Monoid w) => MonadFree f (Lazy.RWST r w s m) where-  wrap fm = Lazy.RWST $ \r s -> wrap $ fmap (\m -> Lazy.runRWST m r s) fm--instance MonadFree f m => MonadFree f (MaybeT m) where-  wrap = MaybeT . wrap . fmap runMaybeT--instance MonadFree f m => MonadFree f (IdentityT m) where-  wrap = IdentityT . wrap . fmap runIdentityT --instance MonadFree f m => MonadFree f (ListT m) where-  wrap = ListT . wrap . fmap runListT--instance (MonadFree f m, Error e) => MonadFree f (ErrorT e m) where-  wrap = ErrorT . wrap . fmap runErrorT-  
− Data/Lens.hs
@@ -1,93 +0,0 @@-module Data.Lens-  ( module Data.Lens.Common-  -- * State API-  , access         -- getter -- :: MonadState a m => Lens a b -> m b-  , (~=), (!=)     -- setter -- :: MonadState a m => Lens a b -> b -> m b-  , (%=), (!%=)    -- modify -- :: MonadState a m => Lens a b -> (b -> b) -> m b-  , (%%=), (!%%=)  -- modify -- :: MonadState a m => Lens a b -> (b -> (c, b)) -> m c-  , (+=), (!+=)    -- modify -- :: (MonadState a m, Num b) => Lens a b -> b -> m b-  , (-=), (!-=)    -- modify -- :: (MonadState a m, Num b) => Lens a b -> b -> m b-  , (*=), (!*=)    -- modify -- :: (MonadState a m, Num b) => Lens a b -> b -> m b-  , (//=), (!/=)   -- modify -- :: (MonadState a m, Fractional b) => Lens a b -> b -> m b-  , (&&=), (!&&=)  -- modify -- :: MonadState a m => Lens a Bool -> Bool -> m Bool-  , (||=), (!||=)  -- modify -- :: MonadState a m => Lens a Bool -> Bool -> m Bool-  ) where--import Control.Comonad.Trans.Store-import Control.Monad.State-import Data.Functor.Identity-import Data.Lens.Common---- * State actions---- | get the value of a lens into state-access :: MonadState a m => Lens a b -> m b-access (Lens f) = gets (pos . f)-{-# INLINE access #-}--infixr 4 ~=, !=---- | set a value using a lens into state-(~=), (!=) :: MonadState a m => Lens a b -> b -> m b-Lens f ~= b = do-  modify (peek b . f)-  return b-Lens f != b = do-  StoreT (Identity h) _ <- gets f-  put (h $! b)-  return b--infixr 4 %=, !%=-    --- | infix modification a value through a lens into state-(%=), (!%=) :: MonadState a m => Lens a b -> (b -> b) -> m b-Lens f %= g = do-  StoreT (Identity h) b <- gets f-  let b' = g b-  put (h b')-  return b'-Lens f !%= g = do-  StoreT (Identity h) b <- gets f-  let b' = g b-  b' `seq` put (h b')-  return b'--infixr 4 %%=, !%%=---- | infix modification of a value through a lens into state--- with a supplemental response-(%%=), (!%%=) :: MonadState a m => Lens a b -> (b -> (c, b)) -> m c-Lens f %%= g = do-  StoreT (Identity h) b <- gets f-  let (c, b') = g b-  put (h b')-  return c-Lens f !%%= g = do-  StoreT (Identity h) b <- gets f-  let (c, b') = g b-  b' `seq` put (h b')-  return c--infixr 4 +=, !+=, -=, !-=, *=, !*=--(+=), (!+=), (-=), (!-=), (*=), (!*=) :: (MonadState a m, Num b) => Lens a b -> b -> m b-f += b = f %= (+ b)-f -= b = f %= subtract b-f *= b = f %= (* b)-f !+= b = f !%= (+ b)-f !-= b = f !%= subtract b-f !*= b = f !%= (* b)--infixr 4 //=, !/=--(//=), (!/=) :: (MonadState a m, Fractional b) => Lens a b -> b -> m b-f //= b = f %= (/ b)-f !/= b = f !%= (/ b)--infixr 4 &&=, !&&=, ||=, !||=--(&&=), (||=), (!&&=), (!||=) :: MonadState a m => Lens a Bool -> Bool -> m Bool-f &&= b = f %= (&& b)-f ||= b = f %= (|| b)-f !&&= b = f !%= (&& b)-f !||= b = f !%= (|| b)
comonads-fd.cabal view
@@ -1,6 +1,6 @@ name:          comonads-fd category:      Control, Comonads-version:       1.7+version:       1.8.0 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -24,11 +24,9 @@     mtl >= 2.0.1.0 && <= 2.1,     semigroups >= 0.5 && < 0.6,     comonad >= 1.1 && < 1.2,-    comonad-transformers >= 1.7 && < 1.8+    comonad-transformers >= 1.8 && < 1.9    exposed-modules:-    Control.Comonad.Cofree-    Control.Comonad.Cofree.Class     Control.Comonad.Discont     Control.Comonad.Discont.Class     Control.Comonad.Discont.Lazy@@ -47,11 +45,6 @@     Control.Comonad.Traced     Control.Comonad.Traced.Class     Control.Comonad.Traced.Memo--    Control.Monad.Free-    Control.Monad.Free.Class--    Data.Lens    ghc-options:      -Wall