<html>
<body>
<font size=3>I suppose I'm thinking of head or tail - e.g. head [] or
tail [].<br>
I'm trying to write my own version of the find function. I have a few
ideas but not quite sure which would be more suitable in the context of
FP.<br>
Any advice would be gratefully received - e.g. do I use recursion, list
comprehension or what?<br>
Thanks, Paul<br><br>
At 00:08 12/09/2007, you wrote:<br>
<blockquote type=cite class=cite cite="">On 9/11/07, PR Stanley
<prstanley@ntlworld.com> wrote:<br>
> Hi<br>
> take 1000 [1..3] still yields [1,2,3]<br>
> I thought it was supposed to return an error.<br>
> Any ideas?<br><br>
No, that's the behavior for take specified in the Haskell 98 report:<br>
<a href="http://haskell.org/onlinereport/standard-prelude.html" eudora="autourl">
http://haskell.org/onlinereport/standard-prelude.html</a><br>
"-- take n, applied to a list xs, returns the prefix of xs of length
n,<br>
-- or xs itself if n > length xs."<br><br>
Cheers,<br>
Tim<br><br>
-- <br>
Tim Chevalier * catamorphism.org * Often in error, never in doubt<br>
"Modesty...is both alien and irrelevant to people who are happy
in<br>
themselves, in their beings, in their skins, their natures, their<br>
capacities."--Anne Sayre</font></blockquote></body>
</html>