Question About lists
Cesar Augusto Acosta Minoli
c_minoli@hotmail.com
Mon, 30 Dec 2002 17:38:13 +0000
<html><div style='background-color:'><DIV>
<P>Hello! I'm Working with Lists in Haskell, I´m a Beginner in Functional Programming and I would like to know if there is a way to write a more efficient function that return the length of a list, I wrote this one:</P>
<P>long :: [a]->Int<BR>long p = longitud p 0<BR> where<BR> longitud [] s=s<BR> longitud (x:xs) s=longitud xs (s+1)</P>
<P>but I think that it have a lineal grow O(n).</P>
<P>thanks!</P>
<P> </P>
<P> </P>
<P> </P>
<P> <BR><BR></P></DIV></div><br clear=all><hr>Add photos to your e-mail with MSN 8. <a href="http://g.msn.com/8HMEEN/2021">Get 3 months FREE*.</a> </html>