Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- fibN :: (Num a, Enum a, Ord a) => a -> [a]
- fibBetter :: Integer -> [Integer]
- fibZip :: Int -> [Integer]
- goldenRatio :: Int -> Double
Documentation
fibN :: (Num a, Enum a, Ord a) => a -> [a] Source #
Calculate a list of Fibonacci numbers of length len
.
Example: >>> fibN 9 [1,1,2,3,5,8,13,21,34]
fibBetter :: Integer -> [Integer] Source #
Better version, recursively construct a list.
Example: >>> fibBetter 8 [1,1,2,3,5,8,13,21]
fibZip :: Int -> [Integer] Source #
Short version, using zip with the same list twice.
Example: >>> fibZip 10 [1,1,2,3,5,8,13,21,34,55]
goldenRatio :: Int -> Double Source #
Calculate the golden ratio.
Example: >>> goldenRatio 4 1.6180555555555556