
10 Apr
2007
10 Apr
'07
10:11 a.m.
On Tue, Apr 10, 2007 at 02:33:41PM +0100, Chris Kuklewicz wrote:
Well, since ((.) :: ShowS -> ShowS -> ShowS) is a Monoid, you can use Writer to create the result:
Not portably. stefan@stefans:~$ ghc-6.4.2 -e '( ("foo"++) `Data.Monoid.mappend` ("bar"++) ) "END"' "foobarEND" stefan@stefans:~$ ghc-6.6 -e '( ("foo"++) `Data.Monoid.mappend` ("bar"++) ) "END"' "fooENDbarEND" -- 6.6 sources instance Monoid b => Monoid (a -> b) where mempty _ = mempty mappend f g x = f x `mappend` g x Stefan