summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConalElliott <>2009-01-21 01:35:47 (GMT)
committerLuite Stegeman <luite@luite.com>2009-01-21 01:35:47 (GMT)
commitee664bcbd5bc02b0333c74136a786cde347932ce (patch)
treecce67a1359af7db72974bc074644e33ad9243e04
parenteab5cddd3acf5d3dd98c6efef4459d99c4d5a56b (diff)
version 0.6.40.6.4
-rwxr-xr-xTypeCompose.cabal2
-rwxr-xr-xsrc/Control/Compose.hs13
-rwxr-xr-xsrc/Data/Zip.hs10
-rw-r--r--wikipage.tw5
4 files changed, 25 insertions, 5 deletions
diff --git a/TypeCompose.cabal b/TypeCompose.cabal
index c4e8361..ad2842e 100755
--- a/TypeCompose.cabal
+++ b/TypeCompose.cabal
@@ -1,5 +1,5 @@
Name: TypeCompose
-Version: 0.6.3
+Version: 0.6.4
Synopsis: Type composition classes & instances
Category: Composition, Control
Description:
diff --git a/src/Control/Compose.hs b/src/Control/Compose.hs
index c34647f..ad010b6 100755
--- a/src/Control/Compose.hs
+++ b/src/Control/Compose.hs
@@ -68,6 +68,9 @@ import Control.Category
import Prelude hiding ((.), id)
#endif
+import Data.Foldable
+import Data.Traversable
+
import Control.Arrow
#if __GLASGOW_HASKELL__ < 610
hiding (pure)
@@ -161,6 +164,16 @@ type O = (:.)
instance (Functor g, Functor f) => Functor (g :. f) where fmap = fmapFF
+-- These next two instances are based on suggestions from Creighton Hogg:
+
+instance (Foldable g, Foldable f, Functor g) => Foldable (g :. f) where
+ foldMap f = fold . fmap (foldMap f) . unO
+
+instance (Traversable g, Traversable f) => Traversable (g :. f) where
+ sequenceA = fmap O . sequenceA . fmap sequenceA . unO
+
+
+
-- instance (Functor g, Functor f) => Functor (g :. f) where
-- fmap = inO.fmap.fmap
diff --git a/src/Data/Zip.hs b/src/Data/Zip.hs
index 0d445a1..d0f9b8c 100755
--- a/src/Data/Zip.hs
+++ b/src/Data/Zip.hs
@@ -1,5 +1,11 @@
-{-# LANGUAGE Rank2Types, TypeOperators, UndecidableInstances #-}
-{-# OPTIONS_GHC -Wall -fenable-rewrite-rules #-}
+{-# LANGUAGE Rank2Types, TypeOperators, UndecidableInstances, CPP #-}
+{-# OPTIONS_GHC -Wall #-}
+#if __GLASGOW_HASKELL__ < 610
+{-# OPTIONS_GHC -frewrite-rules #-}
+#else
+{-# OPTIONS_GHC -fenable-rewrite-rules #-}
+#endif
+
----------------------------------------------------------------------
-- |
-- Module : Data.Zip
diff --git a/wikipage.tw b/wikipage.tw
index 00d2bb1..76a2b2c 100644
--- a/wikipage.tw
+++ b/wikipage.tw
@@ -2,6 +2,7 @@
[[Category:Applicative]]
[[Category:Libraries]]
[[Category:Packages]]
+[[Category:Type-level programming]]
== Abstract ==
@@ -10,8 +11,8 @@
Besides this wiki page, here are more ways to find out about TypeCompose:
* Visit the [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/TypeCompose Hackage page] for library documentation and to download & install.
* Or install with <tt>cabal install TypeCompose</tt>.
-* Get the code repository: <tt>darcs get http://code.haskell.org/TypeCompose</tt>.
-* See the [[TypeCompose/Versions| version history]].
+* Get the code repository: <tt>darcs get http://darcs.haskell.org/packages/TypeCompose</tt>.
+<!--* See the [[TypeCompose/Versions| version history]].-->
== Type composition ==