Theo Norvell writes:
>
>On Tue, 5 Oct 1999, Kevin Atkinson wrote:
>
>> In case you have not figured out a couple of months ago I posted the
>> beginnings of a generic container and algorithm collection for
>> Haskell.
>
> This is exactly the sort of thing that OOP tends to be rather bad at.
> How many times have I written in Java
>  SomeType x = (SomeType)( a_vector.getElement( i ) ) ; 
> thus relying on run-time type checking?
>
> [...]
>
> ML and Haskell represent two approaches to doing "templates"
> right.  Each has their advantages, but both seem to be clearly
> superior to the OOP approach. 

Subtyping based on records and parametric polymorphism with algebraic 
datatypes are in fact orthogonal language features.  OO languages
have preferred the former, functional ones the latter.  There's no
reason why you can't have them both, though.  Check out O'Haskell at
   
   http://www.cs.chalmers.se/~nordland/ohaskell/

Cheers,
Johan



Reply via email to