<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
It's the Endo monoid.<br>
<br>
λ> :t ala Endo foldMap -- see newtype package<br>
ala Endo foldMap :: Foldable t => t (a -> a) -> a -> a<br>
λ> ala Endo foldMap [(+1), (*2)] 8<br>
17<br>
λ> :i ala<br>
ala ::<br>
(Newtype n o, Newtype n' o') =><br>
(o -> n) -> ((o -> n) -> b -> n') -> b -> o'<br>
-- Defined in Control.Newtype<br>
<br>
<br>
On 27/10/12 04:41, Greg Fitzgerald wrote:
<blockquote
cite="mid:CAFLa5WPgJFs5y0ocX31Zv2fihOmfV5LOA+c-y-fqHCVwn94cpQ@mail.gmail.com"
type="cite">
<pre wrap="">Hi Haskellers,
I've recently found myself using the expression: "foldr (.) id" to compose
a list (or Foldable) of functions. It's especially useful when I need to
map a function over the list before composing. Does this function, or the
more general "foldr fmap id", defined in a library anywhere? I googled and
hoogled, but no luck so far.
Thanks,
Greg
</pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Tony Morris
<a class="moz-txt-link-freetext" href="http://tmorris.net/">http://tmorris.net/</a>
</pre>
</body>
</html>