aboutsummaryrefslogblamecommitdiff
path: root/html-test/src/Examples.hs
blob: c8c450f1a3f7c62ac2f56fe104d95974170e0f23 (plain) (tree)
1
2
3
4
5
6
7
8
9




                                         
            
    
             
     
             


                    
            


                    
            


                          
                       
        



                            


                                 
module Examples where

-- | Fibonacci number of given 'Integer'.
--
-- Examples:
--
-- >>> fib 5
-- 5
-- >>> fib 10
-- 55
--
-- >>> fib 10
-- 55
--
-- One more Example:
--
-- >>> fib 5
-- 5
--
-- One more Example:
--
-- >>> fib 5
-- 5
--
-- Example with an import:
--
-- >>> import Data.Char
-- >>> isSpace 'a'
-- False
--
-- >>> putStrLn "foo\n\nbar"
-- foo
-- <BLANKLINE>
-- bar
--
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)