mono-traversable 0.5.0 → 0.6.0
raw patch · 2 files changed
+20/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.MonoTraversable: oand :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool
+ Data.MonoTraversable: oor :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool
- Data.MonoTraversable: oforM_ :: (MonoFoldable mono, MonoFoldable mono, Monad m) => mono -> (Element mono -> m b) -> m ()
+ Data.MonoTraversable: oforM_ :: (MonoFoldable mono, MonoFoldable mono, Monad m) => mono -> (Element mono -> m ()) -> m ()
- Data.MonoTraversable: omapM_ :: (MonoFoldable mono, MonoFoldable mono, Monad m) => (Element mono -> m b) -> mono -> m ()
+ Data.MonoTraversable: omapM_ :: (MonoFoldable mono, MonoFoldable mono, Monad m) => (Element mono -> m ()) -> mono -> m ()
Files
- mono-traversable.cabal +1/−1
- src/Data/MonoTraversable.hs +19/−3
mono-traversable.cabal view
@@ -1,5 +1,5 @@ name: mono-traversable-version: 0.5.0+version: 0.6.0 synopsis: Type classes for mapping, folding, and traversing monomorphic containers description: Monomorphic variants of the Functor, Foldable, and Traversable typeclasses. Contains even more experimental code for abstracting containers and sequences. homepage: https://github.com/snoyberg/mono-traversable
src/Data/MonoTraversable.hs view
@@ -257,11 +257,11 @@ ofor_ = flip otraverse_ {-# INLINE ofor_ #-} - omapM_ :: (MonoFoldable mono, Monad m) => (Element mono -> m b) -> mono -> m ()+ omapM_ :: (MonoFoldable mono, Monad m) => (Element mono -> m ()) -> mono -> m () omapM_ f = ofoldr ((>>) . f) (return ()) {-# INLINE omapM_ #-} - oforM_ :: (MonoFoldable mono, Monad m) => mono -> (Element mono -> m b) -> m ()+ oforM_ :: (MonoFoldable mono, Monad m) => mono -> (Element mono -> m ()) -> m () oforM_ = flip omapM_ {-# INLINE oforM_ #-} @@ -479,7 +479,7 @@ {-# INLINE otoList #-} instance MonoFoldable (Maybe a) where omapM_ _ Nothing = return ()- omapM_ f (Just x) = f x >> return ()+ omapM_ f (Just x) = f x {-# INLINE omapM_ #-} instance MonoFoldable (Tree a) instance MonoFoldable (Seq a) where@@ -621,6 +621,8 @@ ofoldr1Ex _ (Right x) = x ofoldl1Ex' _ (Left _) = Prelude.error "ofoldl1Ex' on Either" ofoldl1Ex' _ (Right x) = x+ omapM_ _ (Left _) = return ()+ omapM_ f (Right x) = f x {-# INLINE ofoldMap #-} {-# INLINE ofoldr #-} {-# INLINE ofoldl' #-}@@ -659,6 +661,20 @@ oproduct :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono oproduct = ofoldl' (*) 1 {-# INLINE oproduct #-}++-- | Are all of the values @True@?+--+-- Since 0.6.0+oand :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool+oand = oall id+{-# INLINE oand #-}++-- | Are any of the values @True@?+--+-- Since 0.6.0+oor :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool+oor = oany id+{-# INLINE oor #-} class (MonoFoldable mono, Monoid mono) => MonoFoldableMonoid mono where -- FIXME is this really just MonoMonad? oconcatMap :: (Element mono -> mono) -> mono -> mono