compactable 0.1.2.0 → 0.1.2.1
raw patch · 2 files changed
+14/−7 lines, 2 filesdep ~basedep ~bifunctorsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, bifunctors
API changes (from Hackage documentation)
- Control.Compactable: instance (GHC.Base.Monoid m, Control.Monad.Trans.Error.Error m) => Control.Compactable.CompactFold (Data.Either.Either m)
+ Control.Compactable: instance GHC.Base.Alternative f => Data.Semigroup.Semigroup (Control.Compactable.AltSum f a)
Files
- compactable.cabal +5/−4
- src/Control/Compactable.hs +9/−3
compactable.cabal view
@@ -1,7 +1,7 @@ name: compactable-version: 0.1.2.0+version: 0.1.2.1 synopsis: A typeclass for structures which can be catMaybed, filtered, and partitioned.-description: This provides polymorphic implimentations for filter, compact (catMaybes), and separate. It allows for higher performance implimentations to be used in place of defaults for all data structures, and endeavors to centerally document those implimentations. Compactable aims to be as general and unconstrained as possible, providing instances for non-Functors like Set, as well as some Contravariants (though not published here). Compactable fully subsumes Data.Witherable, offers more laws, and is more general.+description: This provides polymorphic implementations for filter, compact (catMaybes), and separate. It allows for higher performance implementations to be used in place of defaults for all data structures, and endeavors to centerally document those implementations. Compactable aims to be as general and unconstrained as possible, providing instances for non-Functors like Set, as well as some Contravariants (though not published here). Compactable fully subsumes Data.Witherable, offers more laws, and is more general. license: BSD3 license-file: LICENSE author: Isaac Shapira@@ -11,6 +11,7 @@ build-type: Simple extra-source-files: ChangeLog.md cabal-version: >=1.10+tested-with: GHC == 8.4.1, GHC == 8.2.2, GHC == 8.0.2 source-repository head type: git@@ -21,11 +22,11 @@ -- other-modules: -- other-extensions: ghc-options: -Wall- build-depends: base >= 4.9 && < 4.10.2+ build-depends: base >= 4.9 && < 4.12 , containers >= 0.5.7 && < 0.6 , transformers >= 0.5.2 && < 0.6 , vector >= 0.11 && < 0.13- , bifunctors >= 5.4.2 && < 5.5+ , bifunctors >= 5.4.2 && < 5.6 hs-source-dirs: src default-language: Haskell2010
src/Control/Compactable.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ConstrainedClassMethods #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-}@@ -38,7 +39,6 @@ import Control.Applicative import Control.Arrow import Control.Monad (MonadPlus, join)-import Control.Monad.Trans.Error (Error) import Control.Monad.Trans.Except import Control.Monad.Trans.Maybe import Data.Bifoldable@@ -414,10 +414,17 @@ newtype AltSum f a = AltSum { unAltSum :: f a } deriving (Functor, Applicative, Alternative)-+#if __GLASGOW_HASKELL__ > 840 instance Alternative f => Monoid (AltSum f a) where mempty = empty AltSum a `mappend` AltSum b = AltSum (a <|> b)+#else+instance Alternative f => Semigroup (AltSum f a) where+ AltSum a <> AltSum b = AltSum (a <|> b)+instance Alternative f => Monoid (AltSum f a) where+ mappend = (Data.Semigroup.<>)+ mempty = empty+#endif {-|@@ -494,7 +501,6 @@ {-# INLINEABLE compactFold #-} instance CompactFold Maybe-instance (Monoid m, Error m) => CompactFold (Either m) instance CompactFold IO instance CompactFold ReadP instance CompactFold ReadPrec