21 Dec 19:11
Re: nice simple problem for someone struggling....
Miguel Mitrofanov <miguelimo38 <at> yandex.ru>
2007-12-21 18:11:35 GMT
2007-12-21 18:11:35 GMT
module Mainwhere
data SquareType numberType = Num numberType => SquareConstructor numberType
class ShapeInterface shape where
area :: Num numberType => shape->numberType
data ShapeType = forall a. ShapeInterface a => ShapeType a
instance (Num a) => ShapeInterface (SquareType a) where
area (SquareConstructor side) = side * side
Awesome! That's the first e-mail I see that looks good in HTML!
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed