30 Sep
2007
30 Sep
'07
6:32 p.m.
Hi This was my original version plus some modifications as advised by the list: f c = sum [1 | x <- ['\0'..], x < c] The following version was sent by a list member: f c = length $ takeWhile (<c) ['\0'..] Now, the sender asserted that the first version was much too slow. I'm wondering how the second version is any more efficient than the first. Looking at them through my C programmers' eye, as it were, both would require at least two loops before returning the ANSI value. Any ideas? Thanks, Paul