Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Point-free programming style

Name: Anonymous 2009-01-04 19:30

How do I write the factorial function in point-free?

fact n = foldr1 (*) [1..n]

Which is faster
add1 = 1 +
or
add1 x = 1 + x
???

Name: Anonymous 2009-01-06 11:51

• The factorial of 0 is 1 (not that it matters)
 • An array is a lookup table. http://en.wikipedia.org/wiki/Lookup_table
 • Here it is about 1% slower with an array, about 5% slower with an associative array. (TraceMonkey here too)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List