Nicholls, Mark | 21 Dec 18:31

RE: nice simple problem for someone struggling....

Yes sorry….but this still fails with….

 

“`numberType1' is a rigid type variable bound by”

 

From: Brent Yorgey [mailto:byorgey <at> gmail.com]
Sent: 21 December 2007 17:29
To: Nicholls, Mark
Cc: Jules Bean; haskell-cafe <at> haskell.org
Subject: Re: [Haskell-cafe] nice simple problem for someone struggling....

 

 


"class ShapeInterface shape where
       area :: shape->Int"

now looks dubious....I want it to be something like

"class ShapeInterface shape where
       area :: Num numberType => shape->Int" ?


Rather, I think you probably want

class ShapeInterface shape where
    area :: Num numberType => shape -> numberType

-Brent

 

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane