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-05 13:04

Shame !! is still O(n), so unless I misunderstood something, memorizing it is still less than perfect. Naturally, the facts lazy list is fast.

function bench(x,y,z,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10){var d=new Date();var std=d.getTime();var res=x(y,z,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10);var d2=new Date();var std2=d2.getTime();
var diff=std2-std;return diff}
function loop(x,y,z,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10){for(var i=y-1;i>-1;i--){var res=x(z,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10)}}

var res=x(z,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10)
z10
___/ |/ _ [br]|_  / | | | |
/ /| | |_| |
/___|_|\___/


Fuck, I RAGED. You have not achieved satori. Come back when you have learnt to use arguments/apply.

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