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.
[EMAIL PROTECTED]:~$ ghc-6.4.2 -e '( ("foo"++) `Data.Monoid.mappend` ("bar"++)
) "END"'
"foobarEND"
[EMAIL PROTECTED]:~$ 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe