[Haskell-cafe] need help on exercise
Graham Klyne
GK at ninebynine.org
Sat Jun 26 05:01:19 EDT 2004
At 17:39 25/06/04 -0400, kasager wrote:
>Hi,
> I am working on exercise 12.5 from "Haskell, The Craft of Functional
>Programming, second edition" by Simon Thompson. It asks to make Int an
>instance in the Visible class. I have tried multiple ways of doing this
>however I keep receiving the same error messege when I compile my program,
>saying that my types do not match and i have given a (Num a, Visible a) =>
>String, when it is supposed to be an Int -> String. If anyone could help me
>with this issue it would be greatly appreciated. Thanks, Kelly
From your description, it looks as if you could have syntax problems with
the class instance declaration. It would help if you posted the offending
code excerpt and message.
As far as I can tell, the exercise does not call for use of context
declarations (... => ...).
#g
------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact
More information about the Haskell-Cafe
mailing list