packages feed

free 4.12 → 4.12.1

raw patch · 10 files changed

+106/−14 lines, 10 filesdep ~basenew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Control.Alternative.Free: Alt :: [AltF f a] -> Alt f a
- Control.Alternative.Free: Ap :: f a -> Alt f (a -> b) -> AltF f b
- Control.Alternative.Free: Pure :: a -> AltF f a
- Control.Alternative.Free: alternatives :: Alt f a -> [AltF f a]
- Control.Alternative.Free: instance Typeable Alt
- Control.Alternative.Free: instance Typeable AltF
- Control.Alternative.Free.Final: Alt :: (forall g. Alternative g => (forall x. f x -> g x) -> g a) -> Alt f a
- Control.Alternative.Free.Final: _runAlt :: Alt f a -> forall g. Alternative g => (forall x. f x -> g x) -> g a
- Control.Applicative.Free: Ap :: f a -> Ap f (a -> b) -> Ap f b
- Control.Applicative.Free: Pure :: a -> Ap f a
- Control.Applicative.Free: instance Typeable Ap
- Control.Applicative.Free.Final: Ap :: (forall g. Applicative g => (forall x. f x -> g x) -> g a) -> Ap f a
- Control.Applicative.Free.Final: _runAp :: Ap f a -> forall g. Applicative g => (forall x. f x -> g x) -> g a
- Control.Applicative.Trans.Free: Ap :: f a -> ApT f g (a -> b) -> ApF f g b
- Control.Applicative.Trans.Free: ApT :: g (ApF f g a) -> ApT f g a
- Control.Applicative.Trans.Free: Pure :: a -> ApF f g a
- Control.Applicative.Trans.Free: getApT :: ApT f g a -> g (ApF f g a)
- Control.Applicative.Trans.Free: instance Typeable ApF
- Control.Applicative.Trans.Free: instance Typeable ApT
- Control.Comonad.Cofree: (:<) :: a -> f (Cofree f a) -> Cofree f a
- Control.Comonad.Cofree: instance Typeable Cofree
- Control.Comonad.Trans.Cofree: (:<) :: a -> f b -> CofreeF f a b
- Control.Comonad.Trans.Cofree: CofreeT :: w (CofreeF f a (CofreeT f w a)) -> CofreeT f w a
- Control.Comonad.Trans.Cofree: instance Typeable CofreeF
- Control.Comonad.Trans.Cofree: instance Typeable CofreeT
- Control.Comonad.Trans.Cofree: runCofreeT :: CofreeT f w a -> w (CofreeF f a (CofreeT f w a))
- Control.Comonad.Trans.Coiter: CoiterT :: w (a, CoiterT w a) -> CoiterT w a
- Control.Comonad.Trans.Coiter: instance Typeable CoiterT
- Control.Comonad.Trans.Coiter: runCoiterT :: CoiterT w a -> w (a, CoiterT w a)
- Control.Monad.Free: Free :: (f (Free f a)) -> Free f a
- Control.Monad.Free: Pure :: a -> Free f a
- Control.Monad.Free: instance Typeable Free
- Control.Monad.Free.Church: F :: (forall r. (a -> r) -> (f r -> r) -> r) -> F f a
- Control.Monad.Free.Church: runF :: F f a -> forall r. (a -> r) -> (f r -> r) -> r
- Control.Monad.Trans.Free: Free :: (f b) -> FreeF f a b
- Control.Monad.Trans.Free: FreeT :: m (FreeF f a (FreeT f m a)) -> FreeT f m a
- Control.Monad.Trans.Free: Pure :: a -> FreeF f a b
- Control.Monad.Trans.Free: instance Typeable FreeF
- Control.Monad.Trans.Free: runFreeT :: FreeT f m a -> m (FreeF f a (FreeT f m a))
- Control.Monad.Trans.Free.Church: FT :: (forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r) -> FT f m a
- Control.Monad.Trans.Free.Church: runFT :: FT f m a -> forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r
- Control.Monad.Trans.Iter: IterT :: m (Either a (IterT m a)) -> IterT m a
- Control.Monad.Trans.Iter: instance Typeable IterT
- Control.Monad.Trans.Iter: runIterT :: IterT m a -> m (Either a (IterT m a))
+ Control.Alternative.Free: [Alt] :: [AltF f a] -> Alt f a
+ Control.Alternative.Free: [Ap] :: f a -> Alt f (a -> b) -> AltF f b
+ Control.Alternative.Free: [Pure] :: a -> AltF f a
+ Control.Alternative.Free: [alternatives] :: Alt f a -> [AltF f a]
+ Control.Alternative.Free.Final: [Alt] :: (forall g. Alternative g => (forall x. f x -> g x) -> g a) -> Alt f a
+ Control.Alternative.Free.Final: [_runAlt] :: Alt f a -> forall g. Alternative g => (forall x. f x -> g x) -> g a
+ Control.Applicative.Free: [Ap] :: f a -> Ap f (a -> b) -> Ap f b
+ Control.Applicative.Free: [Pure] :: a -> Ap f a
+ Control.Applicative.Free.Final: [Ap] :: (forall g. Applicative g => (forall x. f x -> g x) -> g a) -> Ap f a
+ Control.Applicative.Free.Final: [_runAp] :: Ap f a -> forall g. Applicative g => (forall x. f x -> g x) -> g a
+ Control.Applicative.Trans.Free: [ApT] :: g (ApF f g a) -> ApT f g a
+ Control.Applicative.Trans.Free: [Ap] :: f a -> ApT f g (a -> b) -> ApF f g b
+ Control.Applicative.Trans.Free: [Pure] :: a -> ApF f g a
+ Control.Applicative.Trans.Free: [getApT] :: ApT f g a -> g (ApF f g a)
+ Control.Comonad.Cofree: [:<] :: a -> f (Cofree f a) -> Cofree f a
+ Control.Comonad.Trans.Cofree: [:<] :: a -> f b -> CofreeF f a b
+ Control.Comonad.Trans.Cofree: [CofreeT] :: w (CofreeF f a (CofreeT f w a)) -> CofreeT f w a
+ Control.Comonad.Trans.Cofree: [runCofreeT] :: CofreeT f w a -> w (CofreeF f a (CofreeT f w a))
+ Control.Comonad.Trans.Coiter: [CoiterT] :: w (a, CoiterT w a) -> CoiterT w a
+ Control.Comonad.Trans.Coiter: [runCoiterT] :: CoiterT w a -> w (a, CoiterT w a)
+ Control.Monad.Free: [Free] :: (f (Free f a)) -> Free f a
+ Control.Monad.Free: [Pure] :: a -> Free f a
+ Control.Monad.Free.Church: [F] :: (forall r. (a -> r) -> (f r -> r) -> r) -> F f a
+ Control.Monad.Free.Church: [runF] :: F f a -> forall r. (a -> r) -> (f r -> r) -> r
+ Control.Monad.Trans.Free: [FreeT] :: m (FreeF f a (FreeT f m a)) -> FreeT f m a
+ Control.Monad.Trans.Free: [Free] :: (f b) -> FreeF f a b
+ Control.Monad.Trans.Free: [Pure] :: a -> FreeF f a b
+ Control.Monad.Trans.Free: [runFreeT] :: FreeT f m a -> m (FreeF f a (FreeT f m a))
+ Control.Monad.Trans.Free.Church: [FT] :: (forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r) -> FT f m a
+ Control.Monad.Trans.Free.Church: [runFT] :: FT f m a -> forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r
+ Control.Monad.Trans.Iter: [IterT] :: m (Either a (IterT m a)) -> IterT m a
+ Control.Monad.Trans.Iter: [runIterT] :: IterT m a -> m (Either a (IterT m a))
- Control.Alternative.Free: liftAlt :: Functor f => f a -> Alt f a
+ Control.Alternative.Free: liftAlt :: (Functor f) => f a -> Alt f a
- Control.Monad.Free: cutoff :: Functor f => Integer -> Free f a -> Free f (Maybe a)
+ Control.Monad.Free: cutoff :: (Functor f) => Integer -> Free f a -> Free f (Maybe a)
- Control.Monad.Free.Church: cutoff :: Functor f => Integer -> F f a -> F f (Maybe a)
+ Control.Monad.Free.Church: cutoff :: (Functor f) => Integer -> F f a -> F f (Maybe a)
- Control.Monad.Trans.Iter: cutoff :: Monad m => Integer -> IterT m a -> IterT m (Maybe a)
+ Control.Monad.Trans.Iter: cutoff :: (Monad m) => Integer -> IterT m a -> IterT m (Maybe a)
- Control.Monad.Trans.Iter: interleave_ :: Monad m => [IterT m a] -> IterT m ()
+ Control.Monad.Trans.Iter: interleave_ :: (Monad m) => [IterT m a] -> IterT m ()
- Control.Monad.Trans.Iter: liftIter :: Monad m => Iter a -> IterT m a
+ Control.Monad.Trans.Iter: liftIter :: (Monad m) => Iter a -> IterT m a
- Control.Monad.Trans.Iter: untilJust :: Monad m => m (Maybe a) -> IterT m a
+ Control.Monad.Trans.Iter: untilJust :: (Monad m) => m (Maybe a) -> IterT m a

Files

.travis.yml view
@@ -1,8 +1,42 @@-language: haskell+env:+ - GHCVER=7.4.2 CABALVER=1.16+ - GHCVER=7.6.3 CABALVER=1.16+ - GHCVER=7.8.4 CABALVER=1.18+ - GHCVER=7.10.1 CABALVER=1.22+ - GHCVER=head CABALVER=1.22++matrix:+  allow_failures:+   - env: GHCVER=head CABALVER=1.22++before_install:+ - travis_retry sudo add-apt-repository -y ppa:hvr/ghc+ - travis_retry sudo apt-get update+ - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH+ - cabal --version++install:+ - travis_retry cabal update+ - cabal install --enable-tests --only-dependencies++script:+ - cabal configure -v2 --enable-tests+ - cabal build+ - cabal sdist+ - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;+   cd dist/;+   if [ -f "$SRC_TGZ" ]; then+      cabal install "$SRC_TGZ";+   else+      echo "expected '$SRC_TGZ' not found";+      exit 1;+   fi+ notifications:   irc:     channels:       - "irc.freenode.org#haskell-lens"     skip_join: true     template:-      - "\x0313free\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"+      - "\x0313free\x0f/\x0306%{branch}\x0f \x0314%{commit}\x0f %{message} \x0302\x1f%{build_url}\x0f"
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+4.12.1+------+* Support GHC 7.4+ 4.12 ---- * Add instances of `MonadCatch` and `MonadThrow` from `exceptions` to `FT`, `FreeT` and `IterT`.
free.cabal view
@@ -1,6 +1,6 @@ name:          free category:      Control, Monads-version:       4.12+version:       4.12.1 license:       BSD3 cabal-version: >= 1.10 license-file:  LICENSE@@ -10,6 +10,7 @@ homepage:      http://github.com/ekmett/free/ bug-reports:   http://github.com/ekmett/free/issues copyright:     Copyright (C) 2008-2015 Edward A. Kmett+tested-with:   GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1 synopsis:      Monads for free description:   Free monads are useful for many tree-like structures and domain specific languages.
src/Control/Applicative/Free.hs view
@@ -5,6 +5,10 @@ {-# LANGUAGE DeriveDataTypeable #-} #endif {-# OPTIONS_GHC -Wall #-}++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Applicative.Free@@ -40,7 +44,10 @@ import Control.Applicative import Data.Functor.Apply import Data.Typeable++#if !(MIN_VERSION_base(4,8,0)) import Data.Monoid+#endif  -- | The free 'Applicative' for a 'Functor' @f@. data Ap f a where
src/Control/Applicative/Free/Final.hs view
@@ -1,4 +1,9 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-}++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Applicative.Free.Final@@ -30,7 +35,10 @@  import Control.Applicative import Data.Functor.Apply++#if !(MIN_VERSION_base(4,8,0)) import Data.Monoid+#endif  -- | The free 'Applicative' for a 'Functor' @f@. newtype Ap f a = Ap { _runAp :: forall g. Applicative g => (forall x. f x -> g x) -> g a }
src/Control/Monad/Free/Class.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-}@@ -7,6 +8,10 @@ {-# LANGUAGE TypeFamilies #-} #endif {-# OPTIONS_GHC -fno-warn-deprecations #-}++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Free.Class@@ -25,7 +30,6 @@   , wrapT   ) where -import Control.Applicative import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Trans.Reader@@ -40,8 +44,11 @@ import Control.Monad.Trans.List import Control.Monad.Trans.Error import Control.Monad.Trans.Identity--- import Control.Monad.Trans.Either++#if !(MIN_VERSION_base(4,8,0))+import Control.Applicative import Data.Monoid+#endif  -- | -- Monads provide substitution ('fmap') and renormalization ('Control.Monad.join'):
src/Control/Monad/Free/TH.hs view
@@ -1,3 +1,9 @@+{-# LANGUAGE CPP #-}++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.TH@@ -27,10 +33,13 @@   ) where  import Control.Arrow-import Control.Applicative import Control.Monad import Data.Char (toLower) import Language.Haskell.TH++#if !(MIN_VERSION_base(4,8,0))+import Control.Applicative+#endif  data Arg   = Captured Type Exp
src/Control/Monad/Trans/Free.hs view
@@ -9,6 +9,10 @@ {-# LANGUAGE DeriveDataTypeable #-} #endif +#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1 #endif@@ -66,7 +70,6 @@ import Control.Monad.Cont.Class import Data.Functor.Bind hiding (join) import Data.Monoid-import Data.Foldable import Data.Function (on) import Data.Functor.Identity import Data.Traversable@@ -76,6 +79,10 @@ import Data.Data import Prelude.Extras +#if !(MIN_VERSION_base(4,8,0))+import Data.Foldable+#endif+ -- | The base functor for a free monad. data FreeF f a b = Pure a | Free (f b)   deriving (Eq,Ord,Show,Read@@ -293,7 +300,8 @@   {-# INLINE throwM #-}  instance (Functor f, MonadCatch m) => MonadCatch (FreeT f m) where-  FreeT m `catch` f = FreeT $ liftM (fmap (`catch` f)) m `catch` (runFreeT . f)+  FreeT m `catch` f = FreeT $ liftM (fmap (`Control.Monad.Catch.catch` f)) m+                                `Control.Monad.Catch.catch` (runFreeT . f)   {-# INLINE catch #-}  -- | Tear down a free monad transformer using iteration.
src/Control/Monad/Trans/Free/Church.hs view
@@ -4,6 +4,10 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} +#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1 #endif@@ -63,13 +67,16 @@ import Control.Monad.Free.Class import Control.Monad.Trans.Free (FreeT(..), FreeF(..), Free) import qualified Control.Monad.Trans.Free as FreeT-import Data.Foldable (Foldable) import qualified Data.Foldable as F-import Data.Traversable (Traversable) import qualified Data.Traversable as T import Data.Functor.Bind hiding (join) import Data.Function +#if !(MIN_VERSION_base(4,8,0))+import Data.Foldable (Foldable)+import Data.Traversable (Traversable)+#endif+ -- | The \"free monad transformer\" for a functor @f@ newtype FT f m a = FT { runFT :: forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r } @@ -173,7 +180,7 @@   {-# INLINE throwM #-}  instance (Functor f, MonadCatch m) => MonadCatch (FT f m) where-  catch m f = toFT $ fromFT m `catch` (fromFT . f)+  catch m f = toFT $ fromFT m `Control.Monad.Catch.catch` (fromFT . f)   {-# INLINE catch #-}  -- | Generate a Church-encoded free monad transformer from a 'FreeT' monad
src/Control/Monad/Trans/Iter.hs view
@@ -6,6 +6,10 @@ {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveDataTypeable #-} +#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1 #endif@@ -89,9 +93,7 @@ import Data.Either import Data.Functor.Bind hiding (join) import Data.Functor.Identity-import Data.Foldable hiding (fold) import Data.Function (on)-import Data.Traversable hiding (mapM) import Data.Monoid import Data.Semigroup.Foldable import Data.Semigroup.Traversable@@ -99,6 +101,11 @@ import Data.Data import Prelude.Extras +#if !(MIN_VERSION_base(4,8,0))+import Data.Foldable hiding (fold)+import Data.Traversable hiding (mapM)+#endif+ -- | The monad supporting iteration based over a base monad @m@. -- -- @@@ -275,7 +282,7 @@   {-# INLINE throwM #-}  instance MonadCatch m => MonadCatch (IterT m) where-  catch (IterT m) f = IterT $ liftM (fmap (`catch` f)) m `catch` (runIterT . f)+  catch (IterT m) f = IterT $ liftM (fmap (`Control.Monad.Catch.catch` f)) m `Control.Monad.Catch.catch` (runIterT . f)   {-# INLINE catch #-}  -- | Adds an extra layer to a free monad value.