[Haskell-cafe] C++ class = neutered (haskell class +
bulat.ziganshin at gmail.com
Mon Aug 21 06:44:57 EDT 2006
Friday, August 18, 2006, 8:54:08 PM, you wrote:
>> classes: lack of record extension mechanisms (such at that implemented
>> in O'Haskell) and therefore inability to reuse operation
>> implementation in an derived data type...
> You can reuse ops in a derived data type but it involves a tremendous amount
> of boilerplate. Essentially, you just use the type classes to simulate
> extendable records by having a method in each class that accesses the
> fixed-length record corresponding to that particular C++ class.
btw, i just found the following in HWN:
* HList updates . Oleg Kiselyov announced that HList, the
library for strongly typed heterogeneous lists, records,
type-indexed products (TIP) and co-products is now accessible via
darcs, here. Additionally, Oleg pointed to some new features
for HList, including a new representation for open records.
Finally, he published a note on how HList supports, natively,
polymorphic variants: extensible recursive open sum datatypes,
quite similar to Polymorphic variants of OCaml. HList thus solves
the `expression problem' -- the ability to add new variants to a
datatype without changing the existing code.
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe