packages feed

semigroupoids 4.0.4 → 4.2

raw patch · 4 files changed

+47/−1 lines, 4 filesdep +base-orphansdep ~distributive

Dependencies added: base-orphans

Dependency ranges changed: distributive

Files

semigroupoids.cabal view
@@ -1,6 +1,6 @@ name:          semigroupoids category:      Control, Comonads-version:       4.0.4+version:       4.2 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE
src/Data/Semigroup/Foldable.hs view
@@ -71,6 +71,9 @@   foldMap1 f (a :| []) = f a   foldMap1 f (a :| b : bs) = f a <> foldMap1 f (b :| bs) +instance Foldable1 ((,) a) where+  foldMap1 f (_, x) = f x+ newtype Act f a = Act { getAct :: f a }  instance Apply f => Semigroup (Act f a) where
src/Data/Semigroup/Traversable.hs view
@@ -73,3 +73,6 @@ instance Traversable1 NonEmpty where   traverse1 f (a :| []) = (:|[]) <$> f a   traverse1 f (a :| (b: bs)) = (\a' (b':| bs') -> a' :| b': bs') <$> f a <.> traverse1 f (b :| bs)++instance Traversable1 ((,) a) where+  traverse1 f (a, b) = (,) a <$> f b
src/Data/Traversable/Instances.hs view
@@ -1,16 +1,56 @@ {-# LANGUAGE CPP #-}+#ifndef MIN_VERSION_transformers+#define MIN_VERSION_transformers(x,y,z) 1+#endif+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif -- | Placeholders for missing instances of Traversable, until base catches up and adds them {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Traversable.Instances where  #if !(MIN_VERSION_transformers(0,3,0)) import Control.Monad.Trans.Identity+#endif++#if !((MIN_VERSION_transformers(0,3,0)) && (MIN_VERSION_base(4,7,0))) import Data.Foldable import Data.Traversable+#endif +#if !(MIN_VERSION_base(4,7,0))+import Control.Applicative+import Data.Monoid+#endif++#if !(MIN_VERSION_transformers(0,3,0)) instance Foldable m => Foldable (IdentityT m) where   foldMap f = foldMap f . runIdentityT  instance Traversable m => Traversable (IdentityT m) where   traverse f = fmap IdentityT . traverse f . runIdentityT+#endif++--------------------------------------++#if !(MIN_VERSION_base(4,7,0))+instance Foldable ((,) b) where+  foldMap f (_, a) = f a++instance Traversable ((,) b) where+  traverse f (b, a) = (,) b <$> f a++instance Foldable (Either a) where+  foldMap _ (Left _) = mempty+  foldMap f (Right a) = f a++instance Traversable (Either a) where+  traverse _ (Left b) = pure (Left b)+  traverse f (Right a) = Right <$> f a++instance Foldable (Const m) where+  foldMap _ _ = mempty++instance Traversable (Const m) where+  traverse _ (Const m) = pure $ Const m #endif