import Data.List (sort)
main = do
putStrLn "Hello World"
--putStrLn (show (sum [1..100000000]))
--h = let z = 2 in z where z = 3
--
--f y = \z -> x + 7 * z - y
--f y z = x + 7 * z - y
--f = \y z -> x + 7 * z - y
type Polynom = [Double]
add :: Polynom -> Polynom -> Polynom
add (x:xs) (y:ys) = x+y : add xs ys
add xs ys = xs ++ ys
eval :: Polynom -> Double -> Double
eval p x = foldr (\a b -> a + x * b) 0 p
deriv :: Polynom -> Polynom
deriv [] = error "[] is no Polynom"
deriv (x:[]) = [0]
deriv (x:xs) = zipWith (*) xs [1..]
fibs = [0,1] ++ zipWith (+) fibs (tail fibs)
fib 0 = 0
fib 1 = 1
fib 2 = 1
fib n = fib (n-1) + fib (n-2)
fibs' = map fib [0..]
fibs'' = zipWith (\f x -> f x) (repeat fib) [0..]
hindex xs = (help . reverse . sort) xs 0
help [] n = n
help (x:xs) n
| x >= n + 1 = help xs (n + 1)
| otherwise = n
--f . g = \x -> f (g x)