summaryrefslogtreecommitdiff
path: root/testcode/test.hs
diff options
context:
space:
mode:
authordwheeler <dwheeler@d762cc98-fd17-0410-9a0d-d09172385bc5>2006-07-07 13:36:27 +0000
committerdwheeler <dwheeler@d762cc98-fd17-0410-9a0d-d09172385bc5>2006-07-07 13:36:27 +0000
commit05095851346f52c8e918176e8e2abdf0b21de5ec (patch)
tree8de964f5eea4c7d80faf34d5d744e215a053ba8f /testcode/test.hs
downloadsloccount-05095851346f52c8e918176e8e2abdf0b21de5ec.tar.gz
Initial import (sloccount 2.26)HEADmaster
git-svn-id: svn://svn.code.sf.net/p/sloccount/code/trunk@1 d762cc98-fd17-0410-9a0d-d09172385bc5
Diffstat (limited to 'testcode/test.hs')
-rw-r--r--testcode/test.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testcode/test.hs b/testcode/test.hs
new file mode 100644
index 0000000..de874df
--- /dev/null
+++ b/testcode/test.hs
@@ -0,0 +1,19 @@
+
+-- This literate program prompts the user for a number
+-- and prints the factorial of that number:
+
+{- This is a comment. -}
+{- This is a comment,
+ too -}
+
+{-# this is a pragma, COUNT IT -}
+
+ main :: IO ()
+ main = do putStr "Enter a number: "
+ l <- readLine
+ putStr "n!= "
+ print (fact (read l))
+ fact :: Integer -> Integer
+ fact 0 = 1
+ fact n = n * fact (n-1)
+