File: Fib.hs

package info (click to toggle)
haskell-doctest 0.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 708 kB
  • sloc: haskell: 3,428; ansic: 3; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 277 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Fib where


-- | Calculate Fibonacci number of given 'Num'.
--
-- Examples:
--
--    >>> fib 10
--    55
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)

-- |
--
-- Examples:
--
--    >>> fib 10
--    55
foo :: Int -> Int
foo = undefined