Infinite loop in haskell? (newbie)

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-25T01:00:03Z Indexed on 2010/05/25 1:01 UTC
Read the original article Hit count: 211

Filed under:

I'm just learning Haskell. I thought this would produce a factorial function...

(within ghci)

Prelude> let ft 0 = 1
Prelude> let ft n = n * ft (n - 1)
Prelude> ft 5

(hangs indefinitely, until ^C).

Can someone point me in the right direction?

Thanks!

© Stack Overflow or respective owner

Related posts about haskell