]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
Add two examples (doctests) for the factorial function.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 9 Jul 2011 00:16:41 +0000 (20:16 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 9 Jul 2011 00:16:41 +0000 (20:16 -0400)
src/Misc.hs

index b2ebeef53c42e470af7e12c58e5e55fdeac74a10..48482b4f69a2cfe580b8b34a605beae82565168b 100644 (file)
@@ -7,6 +7,15 @@ where
 -- | The standard factorial function. See
 --   <http://www.willamette.edu/~fruehr/haskell/evolution.html> for
 --   possible improvements.
+--
+--   Examples:
+--
+--   >>> factorial 0
+--   1
+--
+--   >>> factorial 4
+--   24
+--
 factorial :: Int -> Int
 factorial n
     | n <= 1 = 1