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

Suck it

Name: Anonymous 2007-08-09 15:23 ID:wDfRb0TX

fac n = foldr (*) 1 (take n [1..])

Suck it

Name: Anonymous 2007-08-09 22:39 ID:aNT+HqN1

>>12
Is apply some kind of fold? (I don't know Lisp yet)

>>13
Sorry, but you're the idiot. The function you posted doesn't take any arguments and will just attempt to calculate the product of the infinite list [1..]. Did you think any given parameter would somehow magically be injected as a right bound into the syntactic sugar? You clearly don't have a very good understanding of eta reduction.

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