[Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Keean Schupke
Benjamin Franksen wrote: I still have problems. They are probably due to a wrong definition of the operator (#). Note that (#) is nowhere defined inside the HList sources, so I assumed an inverse application aoperator. This is my program now: No, # is the record selection operator from the

[Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Benjamin Franksen
On Monday 29 November 2004 21:47, Keean Schupke wrote: Benjamin Franksen wrote: I still have problems. They are probably due to a wrong definition of the operator (#). Note that (#) is nowhere defined inside the HList sources, so I assumed an inverse application operator. This is my program

Re: [Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Keean Schupke
Benjamin Franksen wrote: Of course, stupid me. Ok, I changed that. Still won't compile. I post only the first of four type errors (they are all about 40 lines long; note that the inferred type below is almost longer than the complete test program). You'd probably need this as well: {-#

Re: Unique Types in haskell (was Re: OO in Haskell)

1999-10-13 Thread Adrian Hey
On Tue 12 Oct, Kevin Atkinson wrote: I have been meaning to bring this up for quite some time. I think Haskell could really benefit from a uniqueness typing system as it would really simplify many things, such as fast array updates. I have mixed feelings about uniqueness typing. The idea of

Re: OO in Haskell

1999-10-13 Thread Fergus Henderson
On 07-Oct-1999, Michael T. Richter [EMAIL PROTECTED] wrote: At 05:12 PM 10/7/99 , you wrote: Sorry that I really can't explain well why I think that this concept does not fit into Haskell. I must have heard that such "typecase" is most often a bad design. In most situations,

Re: Unique Types in haskell (was Re: OO in Haskell)

1999-10-13 Thread Paul Hudak
So maybe, as you say, uniqueness typing would be useful in Haskell. It seems to give Clean a speed advantage for number/array crunching at present (or so I've heard, though I must confess I've never tried it in either language). Unique types do not provide any efficiency advantage over a

Re: Unique Types in haskell (was Re: OO in Haskell)

1999-10-13 Thread Paul Hudak
I should clarify my comment: If Clean has faster arrays than monadic arrays in Haskell, it is probably due to other issues, such as laziness. I did not mean to imply that Haskell directly supports monadic arrays. But it would be easy to add them in a library, and I believe one is floating

Unique Types in haskell (was Re: OO in Haskell)

1999-10-12 Thread Kevin Atkinson
Lars Lundgren wrote: On Mon, 11 Oct 1999, Adrian Hey wrote: On Mon 11 Oct, Lars Lundgren wrote: I'm sure a lot of poeple have gotten this wrong. I would be surprised if not all the experienced haskellers has this view though. Probably so, but this view seems in complete

Re: OO in Haskell

1999-10-11 Thread Adrian Hey
On Mon 11 Oct, Lars Lundgren wrote: I'm sure a lot of poeple have gotten this wrong. I would be surprised if not all the experienced haskellers has this view though. Probably so, but this view seems in complete contradiction to that of the Clean world. So I'm still confused :-) Regards --

Re: OO in Haskell

1999-10-11 Thread Lars Lundgren
On Mon, 11 Oct 1999, Adrian Hey wrote: On Mon 11 Oct, Lars Lundgren wrote: I'm sure a lot of poeple have gotten this wrong. I would be surprised if not all the experienced haskellers has this view though. Probably so, but this view seems in complete contradiction to that of the Clean

Re: OO in Haskell

1999-10-11 Thread Lars Lundgren
On Fri, 8 Oct 1999, Adrian Hey wrote: On Fri 08 Oct, Lars Lundgren wrote: A value (IO a) *denotes* a program possibly interacting with the world. *That* program is of course not referentially transparent. A haskell program generating an (IO a) on the other hand *is* referetially

Re: OO in Haskell

1999-10-08 Thread Adrian Hey
On Thu 07 Oct, Manuel M. T. Chakravarty wrote: Check out the type signatures of the `MVar'-related operations and you will find that they are all nicely encapsulated in the `IO' monad. This is true, but I think the point of contention is does the IO monad itself provide referential

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Adrian Hey
On Thu 07 Oct, Marcin 'Qrczak' Kowalczyk wrote: In Haskell a `variable' can be meant to be either a name introduced by a let/where/lambda/case binding, or one of IORef/STRef/MVar (or even something in a custom monad). The first concept is referentially transparent, the second is not if we

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Adrian Hey
On Thu 07 Oct, Jan Skibinski wrote: I think that the monadic IO provides us with such a simplification. As long as we realize what are its limitations and as long as we stay within reasonable limits of the concept we should be fine here. The operative word here is "realize". Do we really

Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Adrian Hey
On Thu 07 Oct, I wrote: On Wed 06 Oct, Johan Nordlander wrote: Just to avoid any unfortunate misconceptions: O'Haskell definitely preserves the property we commonly refer to as referential transparency, and so does Concurrent Haskell, or any other sound monadic extension of the language.

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Fergus Henderson
On 07-Oct-1999, Adrian Hey [EMAIL PROTECTED] wrote: On Thu 07 Oct, Michael Hobbs wrote: Michael Hobbs wrote: Consider this: type IO a = StateOfUniverse - (a, StateOfUniverse) -- Not syntactically correct, but you know what I mean. So anything that is declared, say `IO

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Fergus Henderson
On 08-Oct-1999, Adrian Hey [EMAIL PROTECTED] wrote: Reaction to my recent suggestion regarding IO (a concurrent non-deterministic machine) on the Clean discussion list was somewhat less than enthusiastic. One of the reasons was that apparently this would result in loss of referential

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Adrian Hey
Hello again Fergus, For some reason you have sent this message to me despite the fact that all the words you appear to disagree with are those of Michael Hobbs:-) However, I assume you also disagree with my words so I'll try to respond. Unfortunately we've been over this ground before on

Re: OO in Haskell

1999-10-08 Thread Lars Lundgren
On Thu, 7 Oct 1999, Adrian Hey wrote: On Thu 07 Oct, Manuel M. T. Chakravarty wrote: Check out the type signatures of the `MVar'-related operations and you will find that they are all nicely encapsulated in the `IO' monad. This is true, but I think the point of contention is does the

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Fergus Henderson
On 07-Oct-1999, Adrian Hey [EMAIL PROTECTED] wrote: This is another reason I'm sceptical about referential transparency in any functional system of IO (streams, monads, continuations, world as value..) It is hard to sensibly define interaction between a timeless universe of pure functions and

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Fergus Henderson
On 08-Oct-1999, Adrian Hey [EMAIL PROTECTED] wrote: I think it's important to understand whether or not we really do have referential transparency with monadic IO, if other models of interaction between program and outside world are (like those in Concurrent Haskell) going to be rejected

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-08 Thread Adrian Hey
On Thu 07 Oct, Michael Hobbs wrote: Michael Hobbs wrote: Consider this: type IO a = StateOfUniverse - (a, StateOfUniverse) -- Not syntactically correct, but you know what I mean. So anything that is declared, say `IO Int', means that it is actually a function that reads in

Re: OO in Haskell

1999-10-08 Thread Adrian Hey
On Fri 08 Oct, Lars Lundgren wrote: A value (IO a) *denotes* a program possibly interacting with the world. *That* program is of course not referentially transparent. A haskell program generating an (IO a) on the other hand *is* referetially transparent. So a value of type (IO a) is _not_ a

Re: OO in Haskell

1999-10-08 Thread Marcin 'Qrczak' Kowalczyk
Thu, 07 Oct 1999 19:13:34 -0400, Kevin Atkinson [EMAIL PROTECTED] pisze: One think I really think it needs is the ability to group a collection of functions with a tag. And then when importing a module you can ask to only import that tag. For example: module A list: head tail foldr

Re: Re: OO in Haskell

1999-10-07 Thread Juergen Pfitzenmaier
Kevin Atkinson wrote: Java is an evern cleaner language for OO as questionable. Every *new* language should try to recycle the experience gained from its predecessors. In the field of OO one thing springs to my mind: The ability to extend/restrict the signature of a member function in

Re: OO in Haskell

1999-10-07 Thread trb
Adrian Hey writes: On Wed 06 Oct, Johan Nordlander wrote: Just to avoid any unfortunate misconceptions: O'Haskell definitely preserves the property we commonly refer to as referential transparency, and so does Concurrent Haskell, or any other sound monadic extension of the language.

Re: OO in Haskell

1999-10-07 Thread Manuel M. T. Chakravarty
[EMAIL PROTECTED] wrote, Adrian Hey writes: On Wed 06 Oct, Johan Nordlander wrote: Just to avoid any unfortunate misconceptions: O'Haskell definitely preserves the property we commonly refer to as referential transparency, and so does Concurrent Haskell, or any other sound

Re: concurrency (was OO in Haskell)

1999-10-07 Thread Manuel M. T. Chakravarty
[EMAIL PROTECTED] wrote, Manuel M. T. Chakravarty writes: [EMAIL PROTECTED] wrote, I'm not surprised you are puzzled. Concurrent Haskell, as implemented in ghc, does NOT preserve referential transparency, nor could it. Of course it does! If it wouldn't many of the

Re: concurrency (was OO in Haskell)

1999-10-07 Thread trb
Manuel M. T. Chakravarty writes: [EMAIL PROTECTED] wrote, Adrian Hey writes: On Wed 06 Oct, Johan Nordlander wrote: Just to avoid any unfortunate misconceptions: O'Haskell definitely preserves the property we commonly refer to as referential transparency, and so

Re: concurrency (was OO in Haskell)

1999-10-07 Thread Christian Sievers
Tim [EMAIL PROTECTED] wrote: For example, consider a program where one thread prints a value from an MVar, while another thread modifies it. The output of the program will vary from one run to another, even though its input (none) is unchanged. This is not a result of using concurrency. You

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-07 Thread Michael Hobbs
Adrian Hey wrote: I've read this paper, and it is good, but I still see no reason to change my opinion regarding referential transparency and IO. But I am terribly confused about this issue, there seems to be no real consensus about this in the FP world. I just can't see how if the result of

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-07 Thread Michael Hobbs
Michael Hobbs wrote: Adrian Hey wrote: I've read this paper, and it is good, but I still see no reason to change my opinion regarding referential transparency and IO. But I am terribly confused about this issue, there seems to be no real consensus about this in the FP world. I just

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-07 Thread Marcin 'Qrczak' Kowalczyk
Fri, 8 Oct 1999 01:22:43 +0100 (BST), Adrian Hey [EMAIL PROTECTED] pisze: I've read this paper, and it is good, but I still see no reason to change my opinion regarding referential transparency and IO. But I am terribly confused about this issue, there seems to be no real consensus about

Re: Referential Transparency (was Re: OO in Haskell)

1999-10-07 Thread Michael Hobbs
Michael Hobbs wrote: Consider this: type IO a = StateOfUniverse - (a, StateOfUniverse) -- Not syntactically correct, but you know what I mean. So anything that is declared, say `IO Int', means that it is actually a function that reads in the state of the universe, potentially

Re: concurrency (was OO in Haskell)

1999-10-07 Thread Adrian Hey
On Thu 07 Oct, [EMAIL PROTECTED] wrote: See the paper "Concurrent Haskell" by Simon Peyton Jones, Andrew Gordon and Sigbjorn Finne, which states: "forkIO :: IO () - IO () forkIO a is an action which takes an action, a, as its argument and spawns a concurrent process to perform that action.

Re: OO in Haskell

1999-10-07 Thread Kevin Atkinson
Marcin 'Qrczak' Kowalczyk wrote: Tue, 5 Oct 1999 14:10:26 -0400 (EDT), Kevin Atkinson [EMAIL PROTECTED] pisze: 1) Dynamic types. You can't cast up. That is you can't recover the original type from an object in a existential collection. You need to use a dynamic type library for

Re: OO in Haskell

1999-10-07 Thread Marcin 'Qrczak' Kowalczyk
s, passing by value / by reference / by name, deep and shallow copying, evaluation of arguments of and ||, uninitialized variables. And now you come and propose things to make Haskell more OO, changing the things I like the most and adding exactly what I think that OO gets wrong :-) I don't say t

Re: OO in Haskell

1999-10-07 Thread Michael T. Richter
At 05:12 PM 10/7/99 , you wrote: Sorry that I really can't explain well why I think that this concept does not fit into Haskell. I must have heard that such "typecase" is most often a bad design. In most situations, type-casting is a symptom of bad design. The only C++ situation, for

Re: OO in Haskell

1999-10-06 Thread Alex Ferguson
Kevin Atkinson and I argue about C++'s 'Cleaner more natural syntax': I would like to be able to do the things in Haskell that I can do in C++ but currently Haskell's type system is too simple to allow me to do them. There are also some things I can't do in C++ but really wish I could, I

Re: OO in Haskell

1999-10-06 Thread Alex Ferguson
Me: Your 'partial' list would appear, from a initial inspection, to leave little left of either type safety or referential transparency. KA: Could explain how they could. There is a very nice paper written up on True ad-hoc polymorphism. By a build in build in dynamic type system I

Re: OO in Haskell

1999-10-06 Thread Johan Nordlander
Adrian Hey writes: Is referential transparency really such a sacred cow? Sometimes side effects are useful IMHO e.g. for IO. (Though the Cleaners regard IO as being referentially transparent for technical reasons which I don't quite understand.) I've been looking at Concurrent Haskell, and

Re: OO in Haskell

1999-10-06 Thread Fergus Henderson
On 06-Oct-1999, Frank A. Christoph [EMAIL PROTECTED] wrote: Kevin Atkinson wrote: Ok here is my partial list. - True ad-doc polymorphism - Built in dynamic typing system. - State Encapsulation - A solution to the abilities arising from multi parameter type classes. - Syntactic

RE: OO in Haskell

1999-10-06 Thread Simon Peyton-Jones
Kevin writes: | I strongly agree that Haskell can become a *much* more | powerful language | with out losing any of clean syntax or semantics. However, | when ever I | bring up limitations of Haskell type system on this list I either get | ignorance or resistance. I strongly agree that

RE: OO in Haskell

1999-10-06 Thread Frank A. Christoph
Kevin Atkinson wrote: Ok here is my partial list. - True ad-doc polymorphism - Built in dynamic typing system. - State Encapsulation - A solution to the abilities arising from multi parameter type classes. - Syntactic sugar for supporting OO programming styles What is the significance of

Re: OO in Haskell

1999-10-06 Thread Johan Nordlander
Adrian Hey writes: Hmm, I obviously don't understand what 'referential transparency' means. I must say I'm puzzled by statements like this. If the presence of mutable variables (and MVars in Concurrent Haskell) preserve referential transparency, then why _don't_ we have referential

Re: OO in Haskell

1999-10-06 Thread Clifford Beshers
On Wed, 6 Oct 1999, Simon Peyton-Jones wrote: Kevin writes: I think it would be in Carlos interest to modify Marks sample implantation of the type system to support this. Then we can really see if his system will indeed work with the rest of Haskell. Personally, I'm

RE: OO in Haskell

1999-10-06 Thread Kevin Atkinson
On Wed, 6 Oct 1999, Simon Peyton-Jones wrote: Kevin writes: | I strongly agree that Haskell can become a *much* more | powerful language | with out losing any of clean syntax or semantics. However, | when ever I | bring up limitations of Haskell type system on this list I either get

Re: Re: OO in Haskell

1999-10-06 Thread Juergen Pfitzenmaier
Kevin Atkinson wrote: I don't like languages that try to stay simple because doing complex things in simple languages in well, frustrating. Can you agree with me here? What exactly do you mean ? I can put together simple things to get a complex tool that I can view again as a simple

Re: OO in Haskell

1999-10-05 Thread Juergen Pfitzenmaier
Alex Ferguson wrote: That C++ has a very poor type system. and Kevin Atkinson wrote in response: You are going to have to justify it as I thing C++ and Java has a VERY good type system minus the implicit typing system. In fact I *like* the C++ typeing system better than I do Haskell's in

Re: OO in Haskell

1999-10-05 Thread Juergen Pfitzenmaier
Kevin Atkinson wrote: Do you not like OO at all? what good is OO for ? ;) OO gives me a framework/language to talk about objects (read entities) and claims that with objects programmers have the right tool to model real-world entities. But the main thing in the real-world are *not* entities,

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
On Tue, 5 Oct 1999, George Russell wrote: Perhaps I'm being stupid. (It certainly wouldn't be the first time!) But what does OO give me that I can't get with existential types (in datatype definitions) and multiparameter type classes? The latter seem to me much more powerful, since I can

Re: OO in Haskell

1999-10-05 Thread Alex Ferguson
Kevin Atkinson: 2) More specific types, you can't _easilly_ call the more general type. For example in OO this is very commen: class Base virtual foo() do stuff class Derived, extends Base foo() call Base::foo() doo stuff You can certainly do this in Haskell;

Limititions of Haskell Type System (was Re: OO in Haskell)

1999-10-05 Thread Kevin Atkinson
On Tue, 5 Oct 1999, Theo Norvell wrote: On Tue, 5 Oct 1999, Kevin Atkinson wrote: If there is enough interest I could repost this code as well as an explanation of the many "hacks" I had to due to get around ambiguity arising fro the use of multiple parameter classes and other

Re: OO in Haskell

1999-10-05 Thread Johan Nordlander
Theo Norvell writes: On Tue, 5 Oct 1999, Kevin Atkinson wrote: In case you have not figured out a couple of months ago I posted the beginnings of a generic container and algorithm collection for Haskell. This is exactly the sort of thing that OOP tends to be rather bad at. How many times

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
"Hamilton Richards Jr." wrote: One of the more clear-eyed (IMHO) and successful authors of C++ texts is Cay Horstmann. A feature of his text, "Mastering C++" (Wiley, 1991), which I like is the section, appearing at the end of each chapter, entitled "Pitfalls" (the idea comes from Andrew

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
Alex Ferguson wrote: 4) Cleaner more natural syntax. More like C++, you mean? Or Java. Although many OO things can be done in Haskell C++ and Java syntax is more natural more doing OO. If I sound a tad skeptical about some of your suggestions, it may be because you do seem

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
Alex Ferguson wrote: Kevin Atkinson and I argue about C++'s 'Cleaner more natural syntax': I would like to be able to do the things in Haskell that I can do in C++ but currently Haskell's type system is too simple to allow me to do them. There are also some things I can't do in C++ but

Re: OO in Haskell

1999-10-05 Thread Alex Ferguson
Kevin Atkinson: 3) Encapsulation. You can't have private and protected members. Some of this can be done using modules. However it is more work. What exactly can't be done with classes, and how, substantively, is it more work? class Foo private: -- only members of the Foo

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
technically tricky, directions. It may be worth looking at least, if you're certain existing MPC implentations don't allow everything you want to do with containers. Yes MPC is too limiting. I have tried. See my post "Limititions of Haskell Type System (was Re: OO in Haskell)". Ok

Re: OO in Haskell

1999-10-05 Thread Kevin Atkinson
Alex Ferguson wrote: Kevin Atkinson, replying to me... - True ad-doc polymorphism - Built in dynamic typing system - State Encapsulation - A solution to the abilities arising from multi parameter type classes. - Syntactic sugar for supporting OO programming styles ...

Re: OO in Haskell

1999-10-05 Thread Craig Dickson
Kevin Atkinson [EMAIL PROTECTED] wrote: God NO, I like C++ because it is powerful but adding more features on an already ugly (but powerful languge) will make matters worse my making it more powerful but so ugly with so many pitfalls that no one will want to use it. Some would say this has

Re: OO in Haskell (was Re: What *I* thinks Haskell Needs.)

1999-09-29 Thread Fergus Henderson
On 28-Sep-1999, Andreas C. Doering [EMAIL PROTECTED] wrote: The trickier part is putting different types into a heterogenous collection, and then manipulating according to their _individual_ types. If we are already at this point, a naive question: Assume we add the type of all types.

Re: OO in Haskell (was Re: What *I* thinks Haskell Needs.)

1999-09-28 Thread Alex Ferguson
From [EMAIL PROTECTED] Mon Sep 27 18:50:33 1999 X-Authentication-Warning: sun00pg2.wam.umd.edu: kevina owned process doing -bs Date: Mon, 27 Sep 1999 13:50:59 -0400 (EDT) Kevin Atkinson: You have a collection of Shapes. Some of these shapes are circles, however, others are rectangle.

Re: OO in Haskell (was Re: What *I* thinks Haskell Needs.)

1999-09-28 Thread Andreas C. Doering
The trickier part is putting different types into a heterogenous collection, and then manipulating according to their _individual_ types. If we are already at this point, a naive question: Assume we add the type of all types. Hence we can declare a function, say from type to string, we can

OO in Haskell (was Re: What *I* thinks Haskell Needs.)

1999-09-27 Thread Kevin Atkinson
On Mon, 27 Sep 1999, Alex Ferguson wrote: Kevin Atkinson, replying to me: If I understand you correctly, then the best way of doing this would be with existentially (boundedly) quantified data types, currently a non-standard extention present in hbc (and I think, ghc, these days, not

Re: OO in Haskell (was Re: What *I* thinks Haskell Needs.)

1999-09-27 Thread Kevin Atkinson
Alex Ferguson wrote: Kevin Atkinson: You have a collection of Shapes. Some of these shapes are circles, however, others are rectangle. Occasionally you will need to extract these specific shapes form the collection of generic shapes as there is no way to find the length and width of