Steve Frampton wrote:
> I'm having a lot of problems with "Declared type too general", "Type error
> in application", etc. depending on what I try.

Well, it *is* too general. :)

> My function looks sort of like this:
> 
>   foo :: Int -> [a]
>   foo 0 = []
>   foo x = ['1'] ++ foo(x - 1)

According to your implementation, the type of `foo' isn't `Int -> [a]'
it's `Int -> [Char]'. That is, the compiler knows that the only thing
that can ever be in the list is characters. Therefore, it complains when
you claim that it can be a list of "anything".

- Michael Hobbs
[Finally, a message that I can respond to.]



Reply via email to