packages feed

contravariant 1.2.2.1 → 1.3

raw patch · 4 files changed

+29/−23 lines, 4 filesdep +StateVardep −foreign-vardep ~basePVP ok

version bump matches the API change (PVP)

Dependencies added: StateVar

Dependencies removed: foreign-var

Dependency ranges changed: base

API changes (from Hackage documentation)

- Data.Functor.Contravariant: instance [safe] Contravariant SettableVar
+ Data.Functor.Contravariant: instance [safe] Contravariant SettableStateVar

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+1.3+---+* We've merged the `foreign-var` and `StateVar` packages. Transferring support to `StateVar`.+ 1.2.2.1 ------- * Fixed redundant import warnings on GHC 7.10.
contravariant.cabal view
@@ -1,6 +1,6 @@ name:          contravariant category:      Control, Data-version:       1.2.2.1+version:       1.3 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -23,7 +23,7 @@  flag tagged   description:-    You can disable the use of the `tagged` package on older versons of GHC using `-f-tagged`.+    You can disable the use of the `tagged` package using `-f-tagged`.     .     Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.   default: True@@ -31,15 +31,15 @@  flag semigroups   description:-    You can disable the use of the `semigroups` package on older versons of GHC using `-f-semigroups`.+    You can disable the use of the `semigroups` package using `-f-semigroups`.     .     Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.   default: True   manual: True -flag foreign-var+flag StateVar   description:-    You can disable the use of the `foreign-var` package on older versons of GHC using `-f-foreign-var`.+    You can disable the use of the `StateVar` package using `-f-StateVar`.     .     Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.   default: True@@ -59,8 +59,8 @@   if flag(semigroups)     build-depends: semigroups >= 0.15.2 && < 1 -  if flag(foreign-var)-    build-depends: foreign-var < 1+  if flag(StateVar)+    build-depends: StateVar >= 1.1 && < 1.2    if impl(ghc >= 7.4 && < 7.6)     build-depends: ghc-prim
src/Data/Functor/Contravariant.hs view
@@ -66,6 +66,8 @@  import Control.Category +import Data.Function (on)+ import Data.Functor.Product import Data.Functor.Sum import Data.Functor.Constant@@ -90,8 +92,8 @@  import Data.Void -#ifdef MIN_VERSION_foreign_var-import Foreign.Var+#ifdef MIN_VERSION_StateVar+import Data.StateVar #endif  #if __GLASGOW_HASKELL__ >= 702@@ -197,9 +199,9 @@   contramap f = Reverse . contramap f . getReverse   {-# INLINE contramap #-} -#ifdef MIN_VERSION_foreign_var-instance Contravariant SettableVar where-  contramap f (SettableVar k) = SettableVar (k . f)+#ifdef MIN_VERSION_StateVar+instance Contravariant SettableStateVar where+  contramap f (SettableStateVar k) = SettableStateVar (k . f)   {-# INLINE contramap #-} #endif @@ -231,7 +233,7 @@ -- apply its function argument to each input to each input to the -- comparison function. instance Contravariant Comparison where-  contramap f g = Comparison $ \a b -> getComparison g (f a) (f b)+  contramap f g = Comparison $ on (getComparison g) f  #ifdef MIN_VERSION_semigroups instance Semigroup (Comparison a) where@@ -276,7 +278,7 @@ -- apply the contramapped function to each input to the equivalence -- relation. instance Contravariant Equivalence where-  contramap f g = Equivalence $ \a b -> getEquivalence g (f a) (f b)+  contramap f g = Equivalence $ on (getEquivalence g) f  #ifdef MIN_VERSION_semigroups instance Semigroup (Equivalence a) where
src/Data/Functor/Contravariant/Divisible.hs view
@@ -15,8 +15,8 @@  import Data.Void -#if MIN_VERSION_foreign_var-import Foreign.Var+#if MIN_VERSION_StateVar+import Data.StateVar #endif  --------------------------------------------------------------------------------@@ -118,11 +118,11 @@     (b, c) -> g b && h c   conquer = Predicate $ const True -#if MIN_VERSION_foreign_var-instance Divisible SettableVar where-  divide k (SettableVar l) (SettableVar r) = SettableVar $ \ a -> case k a of+#if MIN_VERSION_StateVar+instance Divisible SettableStateVar where+  divide k (SettableStateVar l) (SettableStateVar r) = SettableStateVar $ \ a -> case k a of     (b, c) -> l b >> r c-  conquer = SettableVar $ \_ -> return ()+  conquer = SettableStateVar $ \_ -> return () #endif  --------------------------------------------------------------------------------@@ -193,10 +193,10 @@   lose f = Op $ absurd . f   choose f (Op g) (Op h) = Op $ either g h . f -#if MIN_VERSION_foreign_var+#if MIN_VERSION_StateVar instance Decidable SettableVar where-  lose k = SettableVar (absurd . k)-  choose k (SettableVar l) (SettableVar r) = SettableVar $ \ a -> case k a of+  lose k = SettableStateVar (absurd . k)+  choose k (SettableStateVar l) (SettableStateVar r) = SettableStateVar $ \ a -> case k a of     Left b -> l b     Right c -> r c #endif