packages feed

kan-extensions 1.9.0 → 2.0.0

raw patch · 3 files changed

+17/−5 lines, 3 filesdep ~adjunctionsdep ~representable-functorsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: adjunctions, representable-functors

API changes (from Hackage documentation)

+ Data.Functor.Yoneda: instance Zip f => Zip (Yoneda f)
+ Data.Functor.Yoneda: instance ZipWithKey f => ZipWithKey (Yoneda f)
+ Data.Functor.Yoneda.Contravariant: instance Zip f => Zip (Yoneda f)
+ Data.Functor.Yoneda.Contravariant: instance ZipWithKey f => ZipWithKey (Yoneda f)

Files

Data/Functor/Yoneda.hs view
@@ -38,7 +38,7 @@ import Data.Semigroup.Traversable import Data.Traversable import Text.Read hiding (lift)-import Prelude hiding (sequence, lookup)+import Prelude hiding (sequence, lookup, zipWith)  newtype Yoneda f a = Yoneda { runYoneda :: forall b. (a -> b) -> f b }  @@ -65,6 +65,12 @@ instance Applicative f => Applicative (Yoneda f) where   pure a = Yoneda (\f -> pure (f a))   Yoneda m <*> Yoneda n = Yoneda (\f -> m (f .) <*> n id)++instance Zip f => Zip (Yoneda f) where+  zipWith f (Yoneda m) (Yoneda n) = liftYoneda $ zipWith f (m id) (n id)++instance ZipWithKey f => ZipWithKey (Yoneda f) where+  zipWithKey f (Yoneda m) (Yoneda n) = liftYoneda $ zipWithKey f (m id) (n id)  instance Foldable f => Foldable (Yoneda f) where   foldMap f = foldMap f . lowerYoneda
Data/Functor/Yoneda/Contravariant.hs view
@@ -30,7 +30,7 @@ import Data.Functor.Adjunction import Data.Functor.Representable import Data.Key-import Prelude hiding (sequence, lookup)+import Prelude hiding (sequence, lookup, zipWith) import Text.Read hiding (lift)  -- | The contravariant Yoneda lemma applied to a covariant functor@@ -60,6 +60,12 @@ instance Applicative f => Applicative (Yoneda f) where   pure = liftYoneda . pure   m <*> n = liftYoneda $ lowerYoneda m <*> lowerYoneda n++instance Zip f => Zip (Yoneda f) where+  zipWith f m n = liftYoneda $ zipWith f (lowerYoneda m) (lowerYoneda n)++instance ZipWithKey f => ZipWithKey (Yoneda f) where+  zipWithKey f m n = liftYoneda $ zipWithKey f (lowerYoneda m) (lowerYoneda n)  instance Alternative f => Alternative (Yoneda f) where   empty = liftYoneda empty 
kan-extensions.cabal view
@@ -1,6 +1,6 @@ name:          kan-extensions category:      Data Structures, Monads, Comonads, Functors-version:       1.9.0+version:       2.0.0 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -31,10 +31,10 @@     mtl                    >= 2.0.1.0 && < 2.1,     comonad-transformers   >= 1.8     && < 1.9,     comonads-fd            >= 1.8     && < 1.9,-    adjunctions            >= 1.8     && < 1.9,     keys                   >= 1.8     && < 1.9,     free                   >= 1.8     && < 1.9,-    representable-functors >= 1.8     && < 1.9+    adjunctions            >= 2.0     && < 2.1,+    representable-functors >= 2.0     && < 2.1    exposed-modules:     Control.Comonad.Density