packages feed

contravariant 1.2 → 1.2.0.1

raw patch · 4 files changed

+18/−4 lines, 4 filesdep ~basenew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Data.Functor.Contravariant: instance [safe] Contravariant (Proxy *)
- Data.Functor.Contravariant: instance [safe] Typeable1 Comparison
- Data.Functor.Contravariant: instance [safe] Typeable1 Equivalence
- Data.Functor.Contravariant: instance [safe] Typeable1 Predicate
- Data.Functor.Contravariant: instance [safe] Typeable2 Op
+ Data.Functor.Contravariant: instance [safe] Contravariant Proxy
+ Data.Functor.Contravariant: instance [safe] Typeable Comparison
+ Data.Functor.Contravariant: instance [safe] Typeable Equivalence
+ Data.Functor.Contravariant: instance [safe] Typeable Op
+ Data.Functor.Contravariant: instance [safe] Typeable Predicate
+ Data.Functor.Contravariant.Compose: instance (Applicative f, Decidable g) => Decidable (ComposeFC f g)
- Data.Functor.Contravariant: class Contravariant f where >$ = contramap . const
+ Data.Functor.Contravariant: class Contravariant f where (>$) = contramap . const

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+1.2.0.1+-----+* Fix build on GHC 7.0.4+ 1.1.1 ----- * Added `Data.Functor.Contravariant.Applicative`
Data/Functor/Contravariant.hs view
@@ -10,11 +10,17 @@ #define MIN_VERSION_tagged(x,y,z) 1 #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 && MIN_VERSION_transformers(0,3,0) && MIN_VERSION_tagged(0,6,1)+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif++#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+#if MIN_VERSION_transformers(0,3,0) && MIN_VERSION_tagged(0,6,1) {-# LANGUAGE Safe #-} #else {-# LANGUAGE Trustworthy #-} #endif+#endif  ----------------------------------------------------------------------------- -- |@@ -247,6 +253,7 @@   mempty = Op (const mempty)   mappend (Op p) (Op q) = Op $ \a -> mappend (p a) (q a) +#if MIN_VERSION_base(4,5,0) instance Num a => Num (Op a b) where   Op f + Op g = Op $ \a -> f a + g a   Op f * Op g = Op $ \a -> f a * g a@@ -279,3 +286,4 @@   acosh (Op f) = Op $ acosh . f   Op f ** Op g = Op $ \a -> f a ** g a   logBase (Op f) (Op g) = Op $ \a -> logBase (f a) (g a)+#endif
Data/Functor/Contravariant/Compose.hs view
@@ -39,6 +39,10 @@   conquer = ComposeFC $ pure conquer   divide abc (ComposeFC fb) (ComposeFC fc) = ComposeFC $ divide abc <$> fb <*> fc +instance (Applicative f, Decidable g) => Decidable (ComposeFC f g) where+  lose f = ComposeFC $ pure (lose f)+  choose abc (ComposeFC fb) (ComposeFC fc) = ComposeFC $ choose abc <$> fb <*> fc+ -- | Composition of contravariant and covariant functors newtype ComposeCF f g a = ComposeCF { getComposeCF :: f (g a) } @@ -54,5 +58,3 @@  funzip :: Functor f => f (a, b) -> (f a, f b) funzip = fmap fst &&& fmap snd---- | Composition of contravariant and covariant functors
contravariant.cabal view
@@ -1,6 +1,6 @@ name:          contravariant category:      Control, Data-version:       1.2+version:       1.2.0.1 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE