packages feed

classy-prelude 0.9.1 → 0.9.2

raw patch · 2 files changed

+37/−5 lines, 2 filesdep ~mono-traversablePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: mono-traversable

API changes (from Hackage documentation)

+ ClassyPrelude: and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
+ ClassyPrelude: or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
+ ClassyPrelude: unlessM :: Monad m => m Bool -> m () -> m ()
+ ClassyPrelude: whenM :: Monad m => m Bool -> m () -> m ()
- ClassyPrelude: forM_ :: (Monad m, MonoFoldable c) => c -> (Element c -> m a) -> m ()
+ ClassyPrelude: forM_ :: (Monad m, MonoFoldable c) => c -> (Element c -> m ()) -> m ()
- ClassyPrelude: mapM_ :: (Monad m, MonoFoldable c) => (Element c -> m a) -> c -> m ()
+ ClassyPrelude: mapM_ :: (Monad m, MonoFoldable c) => (Element c -> m ()) -> c -> m ()

Files

ClassyPrelude.hs view
@@ -13,6 +13,8 @@     , WrappedMonoid       -- ** Monad     , module Control.Monad+    , whenM+    , unlessM       -- ** Mutable references     , module Control.Concurrent.MVar.Lifted     , module Control.Concurrent.STM@@ -69,6 +71,8 @@     , forM_     , any     , all+    , and+    , or     , foldl'     , foldr     , foldM@@ -136,7 +140,7 @@ import qualified Prelude import Control.Exception (assert) import Control.Exception.Enclosed-import Control.Monad (when, unless, void, liftM, ap, forever, join, sequence, sequence_, replicateM_)+import Control.Monad (when, unless, void, liftM, ap, forever, join, sequence, sequence_, replicateM_, guard, MonadPlus (..), (=<<), (>=>), (<=<), liftM2, liftM3, liftM4, liftM5) import Control.Concurrent.MVar.Lifted import Control.Concurrent.STM hiding (atomically, always, alwaysSucceeds, retry, orElse, check) import qualified Control.Concurrent.STM as STM@@ -225,17 +229,33 @@  all :: MonoFoldable c => (Element c -> Bool) -> c -> Bool all = oall+{-# INLINE all #-}  any :: MonoFoldable c => (Element c -> Bool) -> c -> Bool any = oany+{-# INLINE any #-} +-- |+--+-- Since 0.9.2+and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool+and = oand+{-# INLINE and #-}++-- |+--+-- Since 0.9.2+or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool+or = oor+{-# INLINE or #-}+ length :: MonoFoldable c => c -> Int length = olength -mapM_ :: (Monad m, MonoFoldable c) => (Element c -> m a) -> c -> m ()+mapM_ :: (Monad m, MonoFoldable c) => (Element c -> m ()) -> c -> m () mapM_ = omapM_ -forM_ :: (Monad m, MonoFoldable c) => c -> (Element c -> m a) -> m ()+forM_ :: (Monad m, MonoFoldable c) => c -> (Element c -> m ()) -> m () forM_ = oforM_  concatMap :: (Monoid m, MonoFoldable c) => (Element c -> m) -> c -> m@@ -494,3 +514,15 @@ checkSTM :: Bool -> STM () checkSTM = STM.check {-# INLINE checkSTM #-}++-- | Only perform the action if the predicate returns @True@.+--+-- Since 0.9.2+whenM :: Monad m => m Bool -> m () -> m ()+whenM mbool action = mbool >>= flip when action++-- | Only perform the action if the predicate returns @False@.+--+-- Since 0.9.2+unlessM :: Monad m => m Bool -> m () -> m ()+unlessM mbool action = mbool >>= flip unless action
classy-prelude.cabal view
@@ -1,5 +1,5 @@ name:                classy-prelude-version:             0.9.1+version:             0.9.2 synopsis:            A typeclass-based Prelude. description:         Focuses on using common typeclasses when possible, and creating new ones to avoid name clashing. Exposes many recommended datastructures (Map, ByteString, etc) directly without requiring long import lists and qualified modules. homepage:            https://github.com/snoyberg/classy-prelude@@ -24,7 +24,7 @@                      , unordered-containers                      , hashable                      , lifted-base                   >= 0.2-                     , mono-traversable              >= 0.3+                     , mono-traversable              >= 0.6                      , exceptions                    >= 0.5                      , semigroups                      , vector-instances