On 11/21/05, David Roundy <[EMAIL PROTECTED]> wrote:
> class Coord a where
>   get_x :: a -> Double
>   get_y :: a -> Double
>   set_x :: Double -> a -> a
>   set_y :: Double -> a -> a
>

I'd say this is a typical OO solution to the problem that doesn't exist

Why do you need setters and getters for coordinate in purely
functional language? Doesn't  data Coord = Coord Double Double,
functional composition and monads solve problems in way better than
inheritance?
The most impressive feature of haskell for me, as a former "OO-design
patterns-UML is great" programmer was that I don't have to and in fact
must not use OO and inheritance and can write code that doesn't leave
you guessing what exactly it is doing and what is not. And that the
language forces you make good design decisions and doesn't let you
make wrong ones. Inheritance  is no doubt one of the most sensless
solutions for code reuse i have ever seen.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to