I Started writing Haskell code . I tried to write a fibonacci function using Guards -
fibo :: (Num z, Ord z) => z -> z
fibo d
| d <= 0 = 0
| d == 1 = 1
| otherwise = fibo (d-1) + fibo (d-2)
I got this error :-
Illegal type signature: ‘(Num z, Ord z) => z -> z fibo d’ Perhaps you intended to use ScopedTypeVariables In a pattern type-signature
However another function - replicate i have written in a similar way which compiled and worked fine . I can write fibonacci in another way , but I want to know what the error was