Objective: Calculate Factorial
Download Link: tinyurl.com/68cjve
Download this file: factorial.rar

Haskell Code:

factorial :: Int -> Int
factorial 0 = 1
factorial n | n > 0 = n*factorial(n-1)


Eric's example:
factorial :: Int -> Int
factorial n = product[1..n]

#1. Replace (...) with tab/space/indentation
#2. Save the text file as .hs file extension, not .txt

You will need to download and install WinHugs or GHC
to run Haskell scripts (.hs extension files).
Download from Haskell official website haskell.org

Loading more stuff…

Hmm…it looks like things are taking a while to load. Try again?

Loading videos…