I suppose I'm thinking of head or tail - e.g. head [] or tail [].
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. Any advice would be gratefully received - e.g. do I use recursion, list comprehension or what?
Thanks, Paul

At 00:08 12/09/2007, you wrote:
On 9/11/07, PR Stanley <[EMAIL PROTECTED]> wrote:
> Hi
> take 1000 [1..3] still yields [1,2,3]
> I thought it was supposed to return an error.
> Any ideas?

No, that's the behavior for take specified in the Haskell 98 report:
http://haskell.org/onlinereport/standard-prelude.html
"-- take n, applied to a list xs, returns the prefix of xs of length n,
-- or xs itself if n > length xs."

Cheers,
Tim

--
Tim Chevalier * catamorphism.org * Often in error, never in doubt
"Modesty...is both alien and irrelevant to people who are happy in
themselves, in their beings, in their skins, their natures, their
capacities."--Anne Sayre
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to