We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 651f937 commit 02124d6Copy full SHA for 02124d6
chapter14-Foldables-and-friends/1.hs
@@ -0,0 +1,9 @@
1
+-- This is a hypothetical program which does not run in GHCi.
2
+
3
+import Data.Monoid
4
5
+instance (Monoid a, Monoid b) => Monoid (a, b) where
6
+ -- mempty :: (a, b)
7
+ mempty = (mempty, mempty)
8
+ -- mappend :: (a, b) -> (a, b) -> (a, b)
9
+ (x1, y1) `mappend` (x2, y2) = (x1 `mappend` x2, y1 `mappend` y2)
0 commit comments