I tried to make a function in Haskell which calculates the Fibonacci-sequence. The Fibonacci-algorithm worked, but then I tried to add a recursive function so I could output a longer sequence and not just one number.

**Code:**

--Fibonacci --The Fibonacci algorithm fib :: Int -> Int fib 0 = 0 fib 1 = 1 fib x = fib(x-1) + fib(x-2) --Recursive loop to repeat the fib-function multiple times repeatFib 0 = 0 repeatFib x = putStrLn $ show $ fib x repeatFib (x - 1) main = repeatFib 10

**Error:**

Quote

haskell_test.hs:12:23:

Couldn't match expected type `(Int -> IO ()) -> Int -> String'

with actual type `Int'

The function `fib' is applied to three arguments,

but its type `Int -> Int' has only one

In the second argument of `($)', namely `fib x repeatFib (x - 1)'

In the second argument of `($)', namely

`read $ fib x repeatFib (x - 1)'

Couldn't match expected type `(Int -> IO ()) -> Int -> String'

with actual type `Int'

The function `fib' is applied to three arguments,

but its type `Int -> Int' has only one

In the second argument of `($)', namely `fib x repeatFib (x - 1)'

In the second argument of `($)', namely

`read $ fib x repeatFib (x - 1)'

I don't really understand the error, but I guess that the fib-function also takes the words on line 13 as an argument...

What am I doing wrong?

Thanks!