[Haskell-cafe] classes question

Joe Fredette jfredett at gmail.com
Mon Nov 9 13:49:17 EST 2009


Oh, crap, I'm sorry, I completely misread your post...

Disregard my previous message.


/Joe

On Nov 9, 2009, at 1:44 PM, Paul Tokarev wrote:

>
> Hi.
>
> I am using Hugs 98
> I have that piece of code:
>
> class PlusTimes a where
>   plus :: a -> a -> a
>
> instance PlusTimes Int where
>   plus x y = x + y
>
> when I run : "plus 2 3" I get this error:
> ERROR - Unresolved overloading
> *** Type       : (Num a, PlusTimes a) => a
> *** Expression : plus 2 3
>
> What am I doing wrong?
> Thanks.
>
> --  
> View this message in context: http://old.nabble.com/classes-question-tp26271257p26271257.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at  
> Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list