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: FrozenVoid !FrOzEn2BUo 2009-01-05 15:45

>>51
Epic fail.
This doesn't handle any arguments.
      var res = f();
This is plain copy of my factorial:
function factorialAnon(x) {
  for(var i = x-1; i > 0; --i)
    x *= i;
  return x;
}

Its obvious without arguments it faster.
However functions which require them will just not work.

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