Hi,

I am porting a C++ program to Haskell.  My current task is to take a class hierarchy and produce something equivalent in Haskell, but I don't seem to be able to get a grip on how type classes and instances contribute to the solution.  Can anyone enlighten me?

Roughly, the class hierarchy in C++ is of the form

class A {
public:
   virtual int do_x(int,int) = 0;
};

class B {
public:
   int do_x(int x,int y) { ...}
};

class C {
public:
   int do_x(int x,int y) { ...}
};

Any help would be greatly appreciated.

Thanks

Simon
courtenage@gmail.com