comonad 3.0.0.2 → 3.0.1.1
raw patch · 2 files changed
+11/−2 lines, 2 filesdep ~semigroupsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: semigroups
API changes (from Hackage documentation)
Files
- Control/Comonad.hs +9/−0
- comonad.cabal +2/−2
Control/Comonad.hs view
@@ -116,29 +116,38 @@ instance Comonad ((,)e) where duplicate p = (fst p, p)+ {-# INLINE duplicate #-} extract = snd+ {-# INLINE extract #-} instance Monoid m => Comonad ((->)m) where duplicate f m = f . mappend m+ {-# INLINE duplicate #-} extract f = f mempty+ {-# INLINE extract #-} instance Comonad Identity where duplicate = Identity+ {-# INLINE duplicate #-} extract = runIdentity+ {-# INLINE extract #-} instance Comonad w => Comonad (IdentityT w) where extend f (IdentityT m) = IdentityT (extend (f . IdentityT) m) extract = extract . runIdentityT+ {-# INLINE extract #-} instance Comonad Tree where duplicate w@(Node _ as) = Node w (map duplicate as) extract (Node a _) = a+ {-# INLINE extract #-} instance Comonad NonEmpty where extend f w@ ~(_ :| aas) = f w :| case aas of [] -> [] (a:as) -> toList (extend f (a :| as)) extract ~(a :| _) = a+ {-# INLINE extract #-} -- | A @ComonadApply w@ is a strong lax symmetric semi-monoidal comonad on the -- category @Hask@ of Haskell types.
comonad.cabal view
@@ -1,6 +1,6 @@ name: comonad category: Control, Comonads-version: 3.0.0.2+version: 3.0.1.1 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -27,7 +27,7 @@ base >= 4 && < 5, transformers >= 0.2 && < 0.4, containers >= 0.3 && < 0.6,- semigroups >= 0.8.3 && < 0.9+ semigroups >= 0.8.3 exposed-modules: Control.Comonad