[Add tests for interactive examples simon.hengel@wiktory.org**20100402141153 Ignore-this: 62a7a2d24768d17a4f3cb27f664853d ] { addfile ./tests/tests/Examples.hs hunk ./tests/tests/Examples.hs 1 +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- ghci> fib 5 +-- 5 +-- ghci> fib 10 +-- 55 +-- +-- ghci> fib 10 +-- 55 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- ghci> import Data.Char +-- ghci> isSpace 'a' +-- False +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) addfile ./tests/tests/Examples.html.ref hunk ./tests/tests/Examples.html.ref 1 + + +
| ||||
| ||||
Synopsis | ||||
| ||||
Documentation | ||||
fib :: Integer -> Integer | ||||
Fibonacci number of given Integer. + Examples: +
One more Example: +
One more Example: +
Example with an import: +
| ||||
Produced by Haddock version 2.7.2 |