On 11-Mar-1999, Steve Frampton <[EMAIL PROTECTED]> wrote:
> 2. I tried playing around with the foo function I was working with
> last time, and am getting a different error now:
> foo :: Int -> [Char]
> foo 0 = []
> foo x = ['1'] ++ foo(x div 10)
>
> [You'll recall last time the last line was: ... foo(x - 1) ]
>
> But now I get:
>
> *** term : foo
> *** type : ((a -> a -> a) -> b -> Int) -> [Char]
> *** does not match : Int -> [Char]
>
> Huh? I tried all manner of things, like ((x::Int) div 10),
> ((x div 10)::Int), etc. to no avail.
You need to write "x `div` 10" rather than "x div 10".
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.