Re: ghc-4.04: memory leak with foreign export dynamic?

1999-09-28 Thread Sven Panne
Armin Groesslinger wrote: I think I have found a memory leak in GHC/FFI. [...] I think it's problem with stable pointers. You can start the following program several times and get several funny results, ranging from a sudden but silent death at different values of count with return value 1 to

Re: CynWinTclHaskell...?

1999-09-28 Thread Alex Ferguson
Does anyone else have experiences of building TclHaskell under CygWin? I'm assured that it ought to be possible, but have had no luck; crib sheets greatly appreciated. (Partial credit for negative results like 'it's a bust, drop back and punt to Linux'.) Cheers, Alex.

Re: CynWinTclHaskell...?

1999-09-28 Thread John Atwood
Alex Ferguson wrote: Does anyone else have experiences of building TclHaskell under CygWin? I'm assured that it ought to be possible, but have had no luck; crib sheets greatly appreciated. (Partial credit for negative results like 'it's a bust, drop back and punt to Linux'.) In

Re: more on Cryptarithm test

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, S.D.Mechveliani [EMAIL PROTECTED] wrote: -- C++ - ... int condition2 (vectorlong x) {int i = 0; while ( i 20x[i]==9-i ) i++; That has undefined behaviour, since your vector `x' only has length 10, not 20. I

Re: more on Cryptarithm test

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, D. Tweed [EMAIL PROTECTED] wrote: One small comment is that in your functions condition1 condition2 I think most C++ programmers would say that you want to write int condition1 (const vectorlong x) since otherwise the compiler generally has to obey the normal function

Re: What *I* thinks Haskell Needs.

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, Alex Ferguson [EMAIL PROTECTED] wrote: Kevin Atkinson: Yes but often putting things in type classes is tedious to do. I also want to be able to overload not only on the TYPE of parameters but also on the NUMBER of parameters. It IS possible to do these things and it

Re: What *I* thinks Haskell Needs.

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, Alex Ferguson [EMAIL PROTECTED] wrote: Fergus Henderson, replying to me: That's far from clear. Certainly, I don't think it's likely to be reasonably possible a conversative extension. [...] Ad-hoc overloading and type inference don't mix so well, because you can

Re: What *I* thinks Haskell Needs.

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, Alex Ferguson [EMAIL PROTECTED] wrote: Fergus Henderson, replying to me: ghc does not offer any facility for type class casts. I'm not clear what's meant by this; are we speaking of some sort of conversion to a common _type_, in some manner? Well, roughly speaking, I'm

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread S. Alexander Jacobson
On Tue, 28 Sep 1999, Adrian Hey wrote: So (a b) = (b a) is invalid has type ::Boolean-Boolean-Boolean _|_ is not of type Boolean. So, if you pass a value of type _|_, you have violated its type requirements (precondition) and should not expect expect a lawful result. Haskell's type

Re: What is a functional language?

1999-09-28 Thread Bjorn Lisper
Me: Yes, it makes a lot of sense. The parallel or above is a classical example of a function for which there exists no semantically correct sequential evaluation order of its arguments (i.e., an evaluation order where an argument is evaluated in full before the evaluation of the next argument

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: To all those who don't like ad-hoc overloading

1999-09-28 Thread Alex Ferguson
Kevin Atkinson: I take it that you are happy with names such as: [long list] Yes. Certainly I'm more than happy that types with completely different signatures have different names.

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

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread Kevin Hammond
At 8:02 pm +0100 28/9/99, Adrian Hey wrote: On Mon 27 Sep, Kevin Hammond wrote: It's entirely possible to have a parallel implementation of a language defining serial pattern matching [**], but in which the actual execution is parallel. Yes, I think I understand. You mean the implementation

efficiency of functional programs

1999-09-28 Thread S.D.Mechveliani
To my benchmark proposal with the determinant programs Juergen Pfitzenmaier [EMAIL PROTECTED] writes The setting for the suggested benchmark needs some clarification. For a dense matrix of sufficient size haskell should be able to beat C. I think Sergey knows this and therefor didn't

RE: Where would one use Maybe as a monad?

1999-09-28 Thread Frank A. Christoph
However, I note that Maybe is an instance of Monad. What for? Someone, I think at Glasgow, has a web page called something like "What the hell are monads?", which I thought gave a pretty good practical description of them. I can't remember who made this page, though. Anybody know

Re: advice wanted on GUI design patterns

1999-09-28 Thread Sven Panne
Antony Courtney wrote: Havoc Pennington wrote: [...] It seems to me that the event-driven model requires "keeping your data" ina way that Haskell does not provide for, because you need to access "the same" data structure in all your event handlers over time, yet there is no way to

RE: What *I* thinks Haskell Needs

1999-09-28 Thread Adrian Hey
On Mon 27 Sep, Frank A. Christoph wrote: I must admit that I don't like the idea of determining a value based on its type, at least in a language like Haskell. For me, functional programming is about how to write programs combinatorially, and justifying your hypotheses by encoding their

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread Martin Norb{ck
--QKdGvSO+nmPlgiQ/ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mon Sep 27 1999, S. Alexander Jacobson - On Tue, 28 Sep 1999, Adrian Hey wrote: =20 So (a b) =3D (b a) is invalid =20 has type ::Boolean-Boolean-Boolean =20 _|_ is not of type

Re: What is a functional language?

1999-09-28 Thread Adrian Hey
On Mon 27 Sep, Bjorn Lisper wrote: Adrian Hey [EMAIL PROTECTED]: This seems completely contrary to normal equational reasoning (which is one thing functional languages are supposed to support), where we aren't so constrained. No. Equational reasoning simply means that we use equations

Re: efficiency of functional programs

1999-09-28 Thread George Russell
"S.D.Mechveliani" wrote: [snip] And why the dense matrix representation is better for Haskell? Rather i would expect it is the sparse one. I really don't think this kind of comparison is going to be very meaningful. I've written some sparse matrix code in C myself. Since memory is often as

improved Cryptarithm test

1999-09-28 Thread S.D.Mechveliani
Fergus Henderson [EMAIL PROTECTED] writes On 28-Sep-1999, S.D.Mechveliani [EMAIL PROTECTED] wrote: D. Tweed [EMAIL PROTECTED] writes T One small comment is that in your functions condition1 condition2 I T think most C++ programmers would say that you want to write T T int condition1

Re: advice wanted on GUI design patterns

1999-09-28 Thread Josef Sveningsson
On Mon, 27 Sep 1999, Havoc Pennington wrote: The question is: how do you structure a GUI program? There is one paper I can recommend that tries to answer this question; "Structuring Graphical Paradigms in TkGofer". It can be found here: http://www.cs.chalmers.se/~koen/Papers/tkgofer.ps The

Re: What *I* thinks Haskell Needs.

1999-09-28 Thread Fergus Henderson
On 27-Sep-1999, Alex Ferguson [EMAIL PROTECTED] 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,

RE: Where would one use Maybe as a monad?

1999-09-28 Thread Julian Seward (Intl Vendor)
However, I note that Maybe is an instance of Monad. What for? Someone, I think at Glasgow, has a web page called something like "What the hell are monads?", which I thought gave a pretty good practical description of them. I can't remember who made this page, though. Anybody know who/where

Re: advice wanted on GUI design patterns

1999-09-28 Thread Havoc Pennington
On Tue, 28 Sep 1999, Manuel M. T. Chakravarty wrote: [very helpful explanation cut, thanks Manuel] There is absolutely no reason why a Haggis-like or FranTk-like framework couldn't be build on top of Gtk+HS. (In fact, there is somebody working on a Haggis-clone for Gtk+HS.) From the

improved Cryptarithm test

1999-09-28 Thread S.D.Mechveliani
To my letter with the "improved" Cryptarithm test Fergus Henderson [EMAIL PROTECTED] writes -- C++ - ... int condition2 (vectorlong x) {int i = 0; while ( i 20x[i]==9-i ) i++; That has undefined behaviour, since your

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread S. Alexander Jacobson
On Tue, 28 Sep 1999, Martin Norb{ck wrote: Oh, but _|_ is a member of the type Boolean. _|_ is a member of all types. For instance, I can write the following: Someone else said this as well. Every login textbook I have seen says that to be a boolean is to be either True or False, not

Re: improved Cryptarithm test

1999-09-28 Thread Dave Tweed
On Tue, 28 Sep 1999, S.D.Mechveliani wrote: I understand this so, that this particular task allows to set `const'. Because first, condition1, condition2 apply to the vector x; as they do not modify x, next_permutation(x) yields the correct value when applied after them.

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread Paul Hudak
Oh, but _|_ is a member of the type Boolean. _|_ is a member of all types. For instance, I can write the following: Someone else said this as well. Every login textbook I have seen says that to be a boolean is to be either True or False, not True, False, or I_dunno. Don't mistake

Re: Sets of IOErrors?

1999-09-28 Thread Alastair Reid
On 08-Sep-1999, Alastair Reid [EMAIL PROTECTED] wrote: What I'd like (in some future version of Haskell) is an IOError constructor which lets me merge two IOErrors together and appropriate operations to test for it and, perhaps, take it apart: Fergus Henderson [EMAIL PROTECTED]

Re: What *I* thinks Haskell Needs.

1999-09-28 Thread Alex Ferguson
Fergus Henderson: One example is the case where you already have existing code that creates a heterogenous collection, and you want to extract an element from that heterogenous collection, and then if it is a member of a particular type class perform action A otherwise perform action B,

Re: Sets of IOErrors?

1999-09-28 Thread Alastair Reid
(b) allow throwing and catching of dynamically typed values, e.g. using an interface like the Hugs/ghc Dynamic library [discussion of Dynamic library, etc deleted] [The following is a bit of a straw-man: it doesn't quite work but may have good parts which can be used in other

Re: advice wanted on GUI design patterns

1999-09-28 Thread Adrian Hey
On Mon 27 Sep, Havoc Pennington wrote: Hi, I'm trying to learn Haskell, and I'm wondering what experiences people have with designing programs with graphical user interfaces. I have none, but I think you need concurrency to do it properly, so perhaps consider looking at Concurrent Haskell

New Gentle Introduction now available.

1999-09-28 Thread John Peterson
I've dumped a new version of the Gentle Intro on haskell.org. We've updated to Haskell 98 (finally!) and added a new chapter on monads. I've also resurrected the ancient online supplement we used to distribute with the late, lamented Yale Haskell compiler so all of the source code is now there

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread S. Alexander Jacobson
On Tue, 28 Sep 1999, Paul Hudak wrote: I'm not sure what you mean by "sane" vs "consistent". Sanity means, in this context that boolean functions comply with boolean logic when passed boolean values. Boolean logic does not specify a behavior for functions with non-boolean domains (like _|_).

Re: Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread Paul Hudak
It's very important that the operational semantics be sound with respect to the declarative semantics. It's much less important that it be complete w.r.t. the declarative semantics. Completeness (in this sense) is often highly overrated, IMHO. I agree. Actually, it's not only overrated,

Haskell and Parallelism (was: What is a functional language?)

1999-09-28 Thread Jan-Willem Maessen
There's been a good deal of debate about parallel versus sequential semantics on this list. As one of the pH (eager, parallel haskell) implementors, I wanted to weigh in on a couple of issues, mostly relating to eager versus lazy semantics. Others have pointed out very nicely the distinction