[Haskell-cafe] nice simple problem for someone struggling....

Jules Bean jules at jellybean.co.uk
Fri Dec 21 10:33:26 EST 2007


Nicholls, Mark wrote:
> *instance* ShapeInterface SquareType *where*
> 
>       area (SquareConstructor sideLength) = sideLength * sideLength


> *data* SquareType a = Num a => SquareConstructor a


Now you have changed your type from SquareType to SquareType a, you need 
to change the instance to:

instance ShapeInterface (SquareType a) where...


Jules


More information about the Haskell-Cafe mailing list