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 19:19 ID:HUEWYzmh

Prelude> let fac = product [1..]
Prelude> fac 4

<interactive>:1:0:
    Couldn't match `Integer' against `t -> t1'
      Expected type: Integer
      Inferred type: t -> t1
    Probable cause: `fac' is applied to too many arguments in the call (fac 4)
    In the definition of `it': it = fac 4
Prelude>


Phail.

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