File: Fib.hs

package info (click to toggle)
haskell-doctest-parallel 0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 648 kB
  • sloc: haskell: 3,207; ansic: 4; makefile: 3
file content (10 lines) | stat: -rw-r--r-- 166 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
module TestSimple.Fib where

-- | Calculate Fibonacci numbers.
--
-- >>> fib 10
-- 55
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)