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

facts

Name: Anonymous 2009-04-21 8:46

ITT: Your favourite implementation of fact.

Mine would be:
fact x = foldr (*) 1 $ takeWhile (/= 1) [x,x-1..]
I wrote it today :3

Name: Anonymous 2009-04-21 14:47

>>23
But it doesn't work. FV's version works for reasonable input (i.e. in cases when it will be actually be used).

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