From: Michael Orlitzky Date: Sat, 9 Jul 2011 00:16:41 +0000 (-0400) Subject: Add two examples (doctests) for the factorial function. X-Git-Tag: 0.0.1~263 X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=effb6b9a8716ce58fed6c8260c57164601a7df30;p=spline3.git Add two examples (doctests) for the factorial function. --- diff --git a/src/Misc.hs b/src/Misc.hs index b2ebeef..48482b4 100644 --- a/src/Misc.hs +++ b/src/Misc.hs @@ -7,6 +7,15 @@ where -- | The standard factorial function. See -- for -- possible improvements. +-- +-- Examples: +-- +-- >>> factorial 0 +-- 1 +-- +-- >>> factorial 4 +-- 24 +-- factorial :: Int -> Int factorial n | n <= 1 = 1