Sarah Xoxo
Sarah Xoxo

Reputation: 115

haskell instance unresolved overloading

I have a class Binaer with the method a_zu_binaer:

> class Binaer a where
>   a_zu_binaer :: a -> String

And an instance:

> instance Binaer Integer where
>   a_zu_binaer b = "needs to be converted"

When I call for example

a_zu_binaer 3 

I get the error Unresolved Overloading

What is the reason for this? How can I solve this problem?

Upvotes: 1

Views: 76

Answers (1)

Teresa Siegmantel
Teresa Siegmantel

Reputation: 903

If you want to enter a multi line definition into ghci, you have to surround it with :{ and :}.

In Your case, the first line declares a class without methods, the second a signature to a unrelated funktion and so on.

I's in general a good idea to store your definitions in a file and use ghci only to try them out.

Upvotes: 0

Related Questions