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 10:21

Did you mean foldr1 (*) [x, x-1 .. 1]

Read Gentle Introduction of Computer Programs.

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