File: ModuleB.hs

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


-- |
-- >>> fib 10
-- 55
-- >>> fib 5
-- 5
fib :: Integer -> Integer
fib = foo

-- |
-- >>> foo 10
-- 55
-- >>> foo 5
-- 5
foo :: Integer -> Integer
foo 0 = 0
foo 1 = 1
foo n = foo (n - 1) + foo (n - 2)