Skip to content

Commit 99ac464

Browse files
committed
[exercise] 14.2
1 parent 02124d6 commit 99ac464

File tree

1 file changed

+9
-0
lines changed
  • chapter14-Foldables-and-friends

1 file changed

+9
-0
lines changed

chapter14-Foldables-and-friends/2.hs

+9
Original file line numberDiff line numberDiff line change
@@ -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 b => Monoid (a -> b) where
6+
-- mempty :: a -> b
7+
mempty _ = mempty
8+
-- mappend :: (a -> b) -> (a -> b) -> a -> b
9+
(f `mappend` g) x = f x `mappend` g x

0 commit comments

Comments
 (0)