Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Peter Verswyvelen
On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.netwrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to present a convincing argument to me why Java gets a free pass for

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Martin Coxall
On 13 Jan 2010, at 09:51, Peter Verswyvelen wrote: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to present a

RE: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Sittampalam, Ganesh
The problem with interfaces as a replacement for type classes is that they only provide dispatch based on the specific type of the first argument (i.e. the receiver). Type classes allow you to dispatch based on return type, and on the instantiations of generic parameters. Neither of these things

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Sebastian Fischer
On Jan 13, 2010, at 11:00 AM, Sittampalam, Ganesh wrote: Type classes allow you to dispatch based on return type, and on the instantiations of generic parameters. Neither of these things is reasonably possible with interfaces. There is recent work that generalises the capabilities of

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Peter Verswyvelen
Yes that is true, but often in Haskell I had to use type annotations when the dispatch is based on the return type, so it also has some tradeoffs. Don't get me wrong, I see the advantages of Haskell's type classes and closures, and I love these. But in Java - if you stay close to OO, and don't

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Gregory Collins
Peter Verswyvelen bugf...@gmail.com writes: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Robert Greayer
On Wed, Jan 13, 2010 at 4:56 AM, Martin Coxall pseudo.m...@me.com wrote: On 13 Jan 2010, at 09:51, Peter Verswyvelen wrote: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Martin Coxall
Anonymous classes in Java close over their lexical environment (can refer to variables in that lexical environment, with values bound at the time of instance construction) with the caveat that only local variables/parameters marked as 'final' may be referred to. Aside from the horrible

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-11-01 Thread Magicloud Magiclouds
I am not saying that the code has to be in OO style. When I say OO is general, I mean I am thinking in OO style. This reflects on modeling, program structure, even code organization. Style is how we present things. I think that is less important than how we think about things. On Sun, Nov 1, 2009

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-11-01 Thread Shelby Moore
Magicloud wrote: I am not saying that the code has to be in OO style. When I say OO is general, I mean I am thinking in OO style. This reflects on modeling, program structure, even code organization. Style is how we present things. I think that is less important than how we think about

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Magicloud Magiclouds
Somehow, I agree with you. I think inherit is not evil, the people use it wrong is. The problem here is, inherit is naked right now. So people could use it wrong. On Fri, Oct 30, 2009 at 7:42 PM, Yaakov Nemoy loupgaroubl...@gmail.com wrote: 2009/10/30 Peter Verswyvelen bugf...@gmail.com: The

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Magicloud Magiclouds
After all, I never think OO as an oppsite way to all other things. The idea is so general that if you say I cannot use it in Haskell at all, that would make me feel weird. The only difference between languages is, some are easy to be in OO style, some are not. 2009/10/31 Andrew Coppin

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Tom Davie
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: After all, I never think OO as an oppsite way to all other things. The idea is so general that if you say I cannot use it in Haskell at all, that would make me feel weird. The only difference between languages is, some are

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Eugene Kirpichov
Yoda Master tells understands he you not, inheritance naked can be how, you clarify please asks he to. 2009/10/31 Magicloud Magiclouds magicloud.magiclo...@gmail.com: Somehow, I agree with you. I think inherit is not evil, the people use it wrong is. The problem here is, inherit is naked right

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Gregory Collins
Tom Davie tom.da...@gmail.com writes: On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: After all, I never think OO as an oppsite way to all other things. The idea is so general that if you say I cannot use it in Haskell at all, that would make me feel weird. The only

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Michael Vanier
Gregory Collins wrote: Tom Davie tom.da...@gmail.com writes: On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: After all, I never think OO as an oppsite way to all other things. The idea is so general that if you say I cannot use it in Haskell at all, that would

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-31 Thread Sebastian Sylvan
On Sun, Nov 1, 2009 at 2:00 AM, Michael Vanier mvanie...@gmail.com wrote: Gregory Collins wrote: Tom Davie tom.da...@gmail.com writes: On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: After all, I never think OO as an oppsite way to all other things. The idea is

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Magnus Therning
On 30/10/09 05:32, Rogan Creswick wrote: On Thu, Oct 29, 2009 at 6:54 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: My concern here is about the data member inheriting. In OOP, when I inherit a class, I also got the members of it. But in haskell, how to inherit a data?

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Martijn van Steenbergen
Magnus Therning wrote: IIRC James Gosling once said that if he were to design Java today he would leave out classes. I suppose partly due to many of the issues with data inheritance. This sounds interesting. Can you link us to an article, please? Thanks, Martijn.

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Magicloud Magiclouds
On this subject, I think, any content inherit would lead to trouble somehow. But is that the reason that we should totally cut them loose? I mean the way of programming developing is easier making (writing), easier maintaining. In fact, I think this is a fork in front of me: Before any new

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Deniz Dogan
2009/10/30 Martijn van Steenbergen mart...@van.steenbergen.nl: Magnus Therning wrote: IIRC James Gosling once said that if he were to design Java today he would leave out classes.  I suppose partly due to many of the issues with data inheritance. This sounds interesting. Can you link us to

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Magnus Therning
On Fri, Oct 30, 2009 at 7:46 AM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Magnus Therning wrote: IIRC James Gosling once said that if he were to design Java today he would leave out classes.  I suppose partly due to many of the issues with data inheritance. This sounds

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Colin Paul Adams
Magnus == Magnus Therning mag...@therning.org writes: Magnus It seems I was wrong in my assumption about data Magnus inheritance, implementation inheritance is just as Magnus evil. Both are fine. -- Colin Adams Preston Lancashire ___

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Peter Verswyvelen
The following is purely my own experience, I have no links to papers of clever people :) I think none of the inheritance techniques work perfectly. E.g. describing everything with OO interfaces (=a extensible record of function pointers) is also problematic IMHO, at least when you have side

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Yaakov Nemoy
2009/10/30 Peter Verswyvelen bugf...@gmail.com: The following is purely my own experience, I have no links to papers of clever people :) I think none of the inheritance techniques work perfectly. E.g. describing everything with OO interfaces (=a extensible record of function pointers) is

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-30 Thread Andrew Coppin
Rogan Creswick wrote: On Thu, Oct 29, 2009 at 6:54 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: My concern here is about the data member inheriting. In OOP, when I inherit a class, I also got the members of it. But in haskell, how to inherit a data? In my

[Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-29 Thread Magicloud Magiclouds
Hi, I think when people talk about OOP, especially the inheriting, their focus mainly is on functions (methods). My concern here is about the data member inheriting. In OOP, when I inherit a class, I also got the members of it. But in haskell, how to inherit a data? -- 竹密岂妨流水过 山高哪阻野云飞

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2009-10-29 Thread Rogan Creswick
On Thu, Oct 29, 2009 at 6:54 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: My concern here is about the data member inheriting. In OOP, when I inherit a class, I also got the members of it. But in haskell, how to inherit a data? In my experience (almost entirely with Java),