mono-traversable 0.6.1 → 0.6.2
raw patch · 2 files changed
+16/−6 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.MinLen: instance Typeable2 MinLen
+ Data.MinLen: instance Typeable MinLen
+ Data.Sequences: catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t
Files
- mono-traversable.cabal +5/−5
- src/Data/Sequences.hs +11/−1
mono-traversable.cabal view
@@ -1,7 +1,7 @@ name: mono-traversable-version: 0.6.1+version: 0.6.2 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.+description: Monomorphic variants of the Functor, Foldable, and Traversable typeclasses. If you understand Haskell's basic typeclasses, you understand mono-traversable. In addition to what you are used to, it adds on an IsSequence typeclass and has code for marking data structures as non-empty. homepage: https://github.com/snoyberg/mono-traversable license: MIT license-file: LICENSE@@ -14,8 +14,8 @@ library ghc-options: -Wall- exposed-modules: Data.Containers- Data.MonoTraversable+ exposed-modules: Data.MonoTraversable+ Data.Containers Data.Sequences Data.NonNull Data.MinLen@@ -69,7 +69,7 @@ main-is: sorting.hs ghc-options: -Wall -O2 default-language: Haskell2010- + source-repository head type: git location: git://github.com/snoyberg/mono-traversable.git
src/Data/Sequences.hs view
@@ -6,12 +6,13 @@ -- | Warning: This module should be considered highly experimental. module Data.Sequences where +import Data.Maybe (fromJust, isJust) import Data.Monoid (Monoid, mconcat, mempty) import Data.MonoTraversable import Data.Int (Int64, Int) import qualified Data.List as List import qualified Control.Monad (filterM, replicateM)-import Prelude (Bool (..), Monad (..), Maybe (..), Ordering (..), Ord (..), Eq (..), Functor (..), fromIntegral, otherwise, (-), not, fst, snd, Integral, ($), flip, maybe, error)+import Prelude (Bool (..), Monad (..), Maybe (..), Ordering (..), Ord (..), Eq (..), Functor (..), fromIntegral, otherwise, (-), fst, snd, Integral, ($), flip, maybe, error) import Data.Char (Char, isSpace) import qualified Data.ByteString as S import qualified Data.ByteString.Lazy as L@@ -1109,3 +1110,12 @@ {-# INLINE toLower #-} {-# INLINE toUpper #-} {-# INLINE toCaseFold #-}++-- | Takes all of the `Just` values from a sequence of @Maybe t@s and+-- concatenates them into an unboxed sequence of @t@s.+--+-- Since 0.6.2+catMaybes :: (IsSequence (f (Maybe t)), Functor f,+ Element (f (Maybe t)) ~ Maybe t)+ => f (Maybe t) -> f t+catMaybes = fmap fromJust . filter isJust