<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I&#39;ve been reviewing the library, and have come unstuck with the <b>id</b> function.<br>

What&#39;s its purpose and can someone give me an example of its practical use.<br></blockquote></div><br>It&#39;s purpose is simply to be the identity function. The type says exactly what it does.<br><br>Prelude&gt; :t id<br>

id :: a -&gt; a<br><br>It&#39;s often useful in combination with higher-order functions.<br><br>Prelude&gt; :t foldr (.) id<br>foldr (.) id :: [a -&gt; a] -&gt; a -&gt; a<br><br>Here&#39;s a slightly complicated way to add a list of numbers:<br>

<br>Prelude&gt; foldr (.) id (map (+) [1..5]) 0<br>15<br><br>Sean<br>