constrictor 0.1.1.2 → 0.1.2.0
raw patch · 2 files changed
+22/−54 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Constrictor: Ap :: f a -> Ap f a
- Constrictor: [getAp] :: Ap f a -> f a
- Constrictor: instance (GHC.Base.Applicative f, Data.Semigroup.Semigroup a) => Data.Semigroup.Semigroup (Constrictor.Ap f a)
- Constrictor: instance (GHC.Base.Applicative f, GHC.Base.Monoid a) => GHC.Base.Monoid (Constrictor.Ap f a)
- Constrictor: instance Control.Monad.Fail.MonadFail f => Control.Monad.Fail.MonadFail (Constrictor.Ap f)
- Constrictor: instance Control.Monad.Fix.MonadFix f => Control.Monad.Fix.MonadFix (Constrictor.Ap f)
- Constrictor: instance Data.Foldable.Foldable f => Data.Foldable.Foldable (Constrictor.Ap f)
- Constrictor: instance Data.Traversable.Traversable f => Data.Traversable.Traversable (Constrictor.Ap f)
- Constrictor: instance GHC.Base.Alternative f => GHC.Base.Alternative (Constrictor.Ap f)
- Constrictor: instance GHC.Base.Applicative f => GHC.Base.Applicative (Constrictor.Ap f)
- Constrictor: instance GHC.Base.Functor f => GHC.Base.Functor (Constrictor.Ap f)
- Constrictor: instance GHC.Base.Monad f => GHC.Base.Monad (Constrictor.Ap f)
- Constrictor: instance GHC.Base.MonadPlus f => GHC.Base.MonadPlus (Constrictor.Ap f)
- Constrictor: instance GHC.Classes.Eq (f a) => GHC.Classes.Eq (Constrictor.Ap f a)
- Constrictor: instance GHC.Classes.Ord (f a) => GHC.Classes.Ord (Constrictor.Ap f a)
- Constrictor: instance GHC.Enum.Enum (f a) => GHC.Enum.Enum (Constrictor.Ap f a)
- Constrictor: instance GHC.Generics.Generic (Constrictor.Ap f a)
- Constrictor: instance GHC.Generics.Generic1 (Constrictor.Ap f)
- Constrictor: instance GHC.Num.Num (f a) => GHC.Num.Num (Constrictor.Ap f a)
- Constrictor: instance GHC.Read.Read (f a) => GHC.Read.Read (Constrictor.Ap f a)
- Constrictor: instance GHC.Show.Show (f a) => GHC.Show.Show (Constrictor.Ap f a)
- Constrictor: newtype Ap f a
Files
- constrictor.cabal +10/−1
- src/Constrictor.hs +12/−53
constrictor.cabal view
@@ -1,7 +1,7 @@ name: constrictor version:- 0.1.1.2+ 0.1.2.0 synopsis: strict versions of many things in base description:@@ -27,6 +27,13 @@ ChangeLog.md cabal-version: >=1.10+tested-with:+ GHC == 7.4.2+ , GHC == 7.8.4+ , GHC == 7.10.3+ , GHC == 8.0.2+ , GHC == 8.2.2+ , GHC == 8.4.2 source-repository head type: git@@ -44,3 +51,5 @@ , transformers default-language: Haskell2010+ ghc-options:+ -Wall -O2
src/Constrictor.hs view
@@ -21,7 +21,7 @@ module Constrictor ( - -- * Strict 'lift-like' functions + -- * Strict lifting functions (<$!>) , fmap' , liftM'@@ -47,59 +47,19 @@ -- ** Strict monadic folds , foldlMapM' , foldrMapM'- -- * Types- -- ** Wrapped applicative functor- , Ap(..) ) where import Prelude hiding (foldr,foldl) -import Control.Applicative (Alternative, Applicative(..), liftA2)-import Control.Monad (MonadPlus, ap, liftM, liftM2)-#if MIN_VERSION_base(4,9,0)-import Control.Monad.Fail (MonadFail)-#endif-import Control.Monad.Fix (MonadFix)+import Control.Applicative (Applicative(..), liftA2)+import Control.Monad (ap, liftM) import Control.Monad.Trans.Cont (ContT(..), cont) import Data.Foldable import Data.Functor.Compose (Compose(..)) import Data.Functor.Identity (runIdentity)-import Data.Monoid hiding ((<>))-#if MIN_VERSION_base(4,9,0)-import Data.Semigroup-#endif+import Data.Monoid (Monoid(mappend,mempty)) import Data.Traversable (traverse,Traversable)-import GHC.Generics (Generic,Generic1) --- | A wrapped applicative functor.--- Please note that base 4.12.0.0 will include this type,--- and it will be removed from this library at that point.-newtype Ap f a = Ap { getAp :: f a }- deriving ( Alternative, Applicative- , Enum, Eq, Foldable, Functor- , Generic-#if MIN_VERSION_base(4,6,0)- , Generic1-#endif- , Monad-#if MIN_VERSION_base(4,9,0)- , MonadFail-#endif- , MonadFix, MonadPlus- , Num, Ord, Read, Show, Traversable- )--#if MIN_VERSION_base(4,9,0)-instance (Applicative f, Semigroup a) => Semigroup (Ap f a) where- (Ap x) <> (Ap y) = Ap $ liftA2 (<>) x y-#endif--instance (Applicative f, Monoid a) => Monoid (Ap f a) where- mempty = Ap $ pure mempty-#if !(MIN_VERSION_base(4,11,0))- mappend (Ap x) (Ap y) = Ap $ liftA2 (mappend) x y-#endif- -- | Lazy in the monoidal accumulator. Monoidal accumulation -- happens from left to right. foldlMapA :: forall t b a f. (Foldable t, Monoid b, Applicative f) => (a -> f b) -> t a -> f b@@ -122,8 +82,8 @@ !br <- f x k $! (mappend bl br) --- Strict in the monoidal accumulator. --- Monoidal accumulation happens from left to right.+-- | Strict in the monoidal accumulator. +-- Monoidal accumulation happens from left to right. foldrMapM' :: forall t b a m. (Foldable t, Monoid b, Monad m) => (a -> m b) -> t a -> m b foldrMapM' f xs = foldl f' return xs mempty where@@ -138,16 +98,16 @@ -- argument and result. -- -- This is re-defined in this module, and not--- just re-exported from @'Control.Monad'@.+-- just re-exported from /Control.Monad/. -- The reason for this is that there is no way -- to hide the docs for re-exports with Haddocks. -- -- In the common case that one might import--- @'Control.Monad'@, we recommend structuring+-- /Control.Monad/, we recommend structuring -- imports like so: -- -- @--- import Control.Monad hiding ((<$!>))+-- import Control.Monad hiding ((\<\$!>)) -- import Constrictor -- @ --@@ -155,12 +115,11 @@ -- -- @ -- import Control.Monad--- import Constrictor hiding ((<$!>))+-- import Constrictor hiding ((\<$!>)) -- @ ----- There should be no side effects (i.e.--- naming/scoping conflicts) introduced as a--- result of structuring one's imports in this way.+-- There should be no unintended side effects+-- introduced as a result of structuring one's imports in this way. (<$!>) :: Monad m => (a -> b) -> m a -> m b {-# INLINE (<$!>) #-} f <$!> m = do