3 Replies - 830 Views - Last Post: 31 March 2010 - 12:16 PM

#1 s243a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 137
  • Joined: 17-March 10

Haskell's overlooked object system

Posted 18 March 2010 - 07:46 PM

This seems interesting:

Quote

Haskell's overlooked object system
Major new release, September 10, 2005

Authors
Oleg Kiselyov and Ralf Lämmel

Abstract
Haskell provides type-class-bounded and parametric polymorphism as opposed to subtype polymorphism of object-oriented languages such as Java and OCaml. It is a contentious question whether Haskell~98 without extensions, or with common extensions, or with new extensions can fully support conventional object-oriented programming with encapsulation, mutable state, inheritance, overriding, statically checked implicit and explicit subtyping, and so on.

In a first phase, we demonstrate how far we can get with object-oriented functional programming, if we restrict ourselves to plain Haskell~98. In the second and major phase, we systematically substantiate that Haskell~98, with some common extensions, supports all the conventional OO features plus more advanced ones, including first-class lexically scoped classes, implicitly polymorphic classes, flexible multiple inheritance, safe downcasts and safe co-variant arguments. Haskell indeed can support width and depth, structural and nominal subtyping. We address the particular challenge to preserve Haskell's type inference even for objects and object-operating functions. Advanced type inference is a strength of Haskell that is worth preserving. Many of the features we get ``for free'': the type system of Haskell turns out to be a great help and a guide rather than a hindrance.

The OO features are introduced in Haskell as the OOHaskell library, non-trivially based on the HList library of extensible polymorphic records with first-class labels and subtyping. The library sample code, which is patterned after the examples found in OO textbooks and programming language tutorials, including the OCaml object tutorial, demonstrates that OO code translates into OOHaskell in an intuition-preserving way: essentially expression-by-expression, without requiring global transformations.

OOHaskell lends itself as a sandbox for typed OO language design.

http://homepages.cwi...skell/paper.pdf

Is This A Good Question/Topic? 0
  • +

Replies To: Haskell's overlooked object system

#2 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 590
  • View blog
  • Posts: 2,792
  • Joined: 05-January 09

Re: Haskell's overlooked object system

Posted 30 March 2010 - 11:53 PM

While amazingly interesting, and definitely goes to show just how awesome Haskell is, Object Oriented Haskell really kills the point, as I've mentioned before.

Besides that, all of the Haskell OOP stuff is old and outdated, except for Timber, but I'm not sure anyone really uses that at all.
Was This Post Helpful? 0
  • +
  • -

#3 s243a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 137
  • Joined: 17-March 10

Re: Haskell's overlooked object system

Posted 31 March 2010 - 05:07 AM

View PostRaynes, on 30 March 2010 - 10:53 PM, said:

While amazingly interesting, and definitely goes to show just how awesome Haskell is, Object Oriented Haskell really kills the point, as I've mentioned before.

Besides that, all of the Haskell OOP stuff is old and outdated, except for Timber, but I'm not sure anyone really uses that at all.

Scanning it briefly, it looks to me that one would want to use timber if they wanted a functional programing feel but wanted to use event driven programing. I would think this because of the reactive object concept:
http://www.timber-la...dex_gentle.html
I know that there are alternatives to doing this in Haskel. I remember reading about a client server model for instance that is implemented using lazy evaluation. I'm not sure how the Haskel gui packages are built. However, I think there is an argument that strict evaluation leads to more predictable results and therefore perhaps timber is more appropriate for real time systems ad advertised.
Was This Post Helpful? 0
  • +
  • -

#4 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 590
  • View blog
  • Posts: 2,792
  • Joined: 05-January 09

Re: Haskell's overlooked object system

Posted 31 March 2010 - 12:16 PM

The Haskell GTK bindings are pretty amazing, though you obviously have to code in quite an imperative way while using them. This has lead to a lot of work in FRP ( http://www.haskell.o...ive_Programming ), and there are some GUI toolkits floating around that are supposedly 'more Haskellish'. The most likely reason wxWidgets and GTK are used over them is because of plain ol' popularity. GTK and wxWidgets are tried and true.

This post has been edited by Raynes: 31 March 2010 - 12:17 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1