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

2006-08-21 Thread Bulat Ziganshin
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,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2006-08-19 Thread Bulat Ziganshin
Hello Brian,

Friday, August 18, 2006, 8:54:08 PM, you wrote:
 http://haskell.org/haskellwiki/OOP_vs_type_classes
 although i mentioned not only pluses but also drawbacks of type
 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.

of course, but it's just OOP emulation. one can do the same in C, for
example.

i've added your letter to the page. but anyway, one of key OOP
ideas was extensible records, it was idea what distinguished OOP from
abstract data types approach



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe