[Haskell-cafe] C++ class = neutered (haskell class + haskellexistential)

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Aug 21 06:44:57 EDT 2006

Hello Brian,

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 [17]announced that HList, the
       library for strongly typed heterogeneous lists, records,
       type-indexed products (TIP) and co-products is now accessible via
       darcs, [18]here. Additionally, Oleg pointed to some new features
       for HList, including a new representation for open records.
       Finally, he [19]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.

  17. http://article.gmane.org/gmane.comp.lang.haskell.general/13905
  18. http://darcs.haskell.org/HList/
  19. http://article.gmane.org/gmane.comp.lang.haskell.general/13906

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list