[Haskell-cafe] Re: Quest for inheritance

Andre Pang ozone at algorithm.com.au
Tue Jun 7 16:36:03 EDT 2005

On 06/06/2005, at 3:47 PM, Cédric Paternotte wrote:

>> Manuel Chakravarty and I also wrote a paper titled "Interfacing
>> Haskell to Object-Oriented Languages" that you might find useful:
> I've been reading it and from what I understood the technique you've
> come up with is used to model foreign OO language hierarchies so that
> Haskell can interface with them. My question is can you use it to code
> in Haskell in a OO way or is it just meant to provide bridges to these
> foreign OO objects ?

I don't think there's any real barrier to coding Haskell in an OO  
way, though my personal motivation for the paper was really to use it  
as a primitive bridging layer, and build a more functional interface  
on top of it.  wxHaskell is a good example of this: it provides a  
more Haskell-like interface on top of a basic layer to wxWidgets via  
a layer named wxCore.  Note that Mocha (which is discussed in the  
paper) has been succeeded by HOC: <http://hoc.sf.net/>, although  
that's probably of serious interest to you if you have a Mac.

> I noticed most examples in the paper were related to the matters of
> interfacing. Or is it more than that ? Could you, for instance, craft
> a version of, say, the Shapes example with this approach ?

You could definitely craft up a Shapes example with the interfaces  
presented in the paper; if you think of an OO library that exports  
Shapes as a public API, then making an interface to this library vs  
crafting the Shapes example is the same thing.

% Andre Pang : trust.in.love.to.save  <http://www.algorithm.com.au/>

More information about the Haskell-Cafe mailing list