Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Benjamin Franksen
On Thursday 17 November 2005 03:44, Cale Gibbard wrote: On 16/11/05, Stefan Monnier [EMAIL PROTECTED] wrote: Indeed! I always use braces and semicolons with do-notation. You are free to do so too! Nothing requires you to use layout. Indeed, you can freely mix the two. I would

RE: [Haskell-cafe] Reducing # of context switches

2005-11-17 Thread Simon Marlow
On 17 November 2005 00:17, Joel Reymont wrote: The latest GHC docs mention that the -C option takes a seconds value whereas prior docs mention microseconds. Which is it? Also, do I pass +RTS -Cxxx or is it just -C? It is in seconds, eg. +RTS -C0.5 for switches every half a second. I've

RE: [Haskell-cafe] layout problem

2005-11-17 Thread Simon Marlow
On 16 November 2005 17:15, Christian Maeder wrote: Simon Peyton-Jones wrote: Indeed! I always use braces and semicolons with do-notation. You are free to do so too! Nothing requires you to use layout. Indeed, you can freely mix the two. I would not recommend braces and semicolons,

Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Ketil Malde
Benjamin Franksen wrote: If your editor is a little smarter still, it can do the Haskell layout without braces automatically too. The emacs mode helps with this. Yi/hIDE should be able to do it perfectly once it's in a generally usable state. :) Hmm, how would your super intelligent text

Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Philippa Cowderoy
On Wed, 16 Nov 2005, Cale Gibbard wrote: If your editor is a little smarter still, it can do the Haskell layout without braces automatically too. The emacs mode helps with this. Yi/hIDE should be able to do it perfectly once it's in a generally usable state. :) The one I'm looking forward

[Haskell-cafe] Project postmortem

2005-11-17 Thread Joel Reymont
Folks, I have done a lot of experiments over the past few weeks and came to a few interesting conclusions. First some background, then issues, solutions and conclusions. I wrote a test harness for a poker server that understands the different binary packets and can send and receive them.

Re: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Joel Reymont
On Nov 17, 2005, at 1:44 PM, Sebastian Sylvan wrote: Are you sure it's safe to kill a thread which has already been killed? It seems so from the docs. Why do you fork off the killing of the threads? Why not just run them in sequence? Someone said that they read somewhere that killThread

Re: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Sebastian Sylvan
On 11/17/05, Joel Reymont [EMAIL PROTECTED] wrote: On Nov 17, 2005, at 1:44 PM, Sebastian Sylvan wrote: Are you sure it's safe to kill a thread which has already been killed? It seems so from the docs. Why do you fork off the killing of the threads? Why not just run them in sequence?

Re: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Joel Reymont
Maybe one of the Simons can comment on this. I distinctly remember trying the mdo approach to kill the other thread and getting burned by that. Don't know why I forgot to mention it. On Nov 17, 2005, at 2:03 PM, Sebastian Sylvan wrote: What I do remember is that the timeout and parIO

RE: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Simon Marlow
On 16 November 2005 17:38, Joel Reymont wrote: I'm getting crashes like this and I cannot figure out what the problem is. I'm launching a bunch of threads that connect to a server via TCP and exchange packets. I am running operations like connect and receive in a timeout function that

Re: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Joel Reymont
I will work on the repro case over the weekend. Getting this to work correctly is crucial to the future of Haskell, I think. Without this working correctly there's a slim chance of Haskell being used successfully used for high-performance networking apps. On Nov 17, 2005, at 3:00 PM, Simon

[Haskell-cafe] Re: ReaderT and concurrency

2005-11-17 Thread Chung-chieh Shan
In http://www.eecs.harvard.edu/~ccshan/prepose/prepose.pdf Oleg and I survey the approaches that others have mentioned and propose a new technique that is particularly relevant in concurrent programs. Ken -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig If

Re: [Haskell-cafe] Spurious program crashes

2005-11-17 Thread Joel Reymont
Actually, this has just become crucial for me. In my using of hWaitForInput I missed that it blocks all other threads if no input is available :-(. Arghh! I still need timeouts. On Nov 17, 2005, at 3:00 PM, Simon Marlow wrote: Regarding the behaviour of killThread, I believe the version in

[Haskell-cafe] Darcs and the Google Base

2005-11-17 Thread Dimitry Golubovsky
This may be just funny, but... As the Google Base went live yesterday (11/16/2005), I tried to add the information about my HSFFIG project to the Base. As the Base allows to define arbitrary attributes (labels) for each item, I added the two of Web URL type: CABAL and DARCS holding urls for the

[Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Joel Reymont
I second this motion! I rather like Simon's proposal. On Nov 17, 2005, at 5:00 PM, Fraser Wilson wrote: Yeah, I thought you might have tried that at some point :-) I like http://research.microsoft.com/~simonpj/Haskell/records.html cheers, Fraser. On 11/17/05, Joel Reymont [EMAIL PROTECTED]

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Greg Woodhouse
Isn't there a potential for confusion with function composition (f . g)? That being said, I like this idea (I just need to think it through a bit).Joel Reymont [EMAIL PROTECTED] wrote: I second this motion! I rather like Simon's proposal.On Nov 17, 2005, at 5:00 PM, Fraser Wilson wrote: Yeah, I

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Sebastian Sylvan
On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a potential for confusion with function composition (f . g)? That being said, I like this idea (I just need to think it through a bit). I've been wanting this for ages. It's SO much better than the current horribly broken

[Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Dimitry Golubovsky
Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function composition in a way which doesn't obfuscate your code? I use ($) way more often than (.). Some people do use it more often than I

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Joel Reymont
So it sounds to me that momentum is building behind Simon PJ's proposal and that we are finally getting somewhere! Now, when can we actually get this in GHC? On Nov 17, 2005, at 5:56 PM, Sebastian Sylvan wrote: I've been wanting this for ages. It's SO much better than the current horribly

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Chris Kuklewicz
Would the record system describe at http://lambda-the-ultimate.org/node/view/1119 also be convertable into System Fw, GHC's existing, strongly-typeed intermediate language. ? On Thu, November 17, 2005 17:56, Sebastian Sylvan said: On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Cale Gibbard
Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function composition in a way which doesn't obfuscate your code? I use ($) way more often than (.). Some people do use it more often than I

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Fraser Wilson
On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a potential for confusion with function composition (f . g)? Perhaps, but I always have spaces on either side when it's function composition. Isn't there already an ambiguity? -- I bet there's a quicker way to do this ... module M

Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Benjamin Franksen
On Thursday 17 November 2005 11:42, Ketil Malde wrote: Benjamin Franksen wrote: If your editor is a little smarter still, it can do the Haskell layout without braces automatically too. The emacs mode helps with this. Yi/hIDE should be able to do it perfectly once it's in a generally usable

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Jon Fairbairn
On 2005-11-17 at 13:21EST Cale Gibbard wrote: Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function composition in a way which doesn't obfuscate your code? I use ($) way more

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Benjamin Franksen
On Thursday 17 November 2005 19:21, Cale Gibbard wrote: Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function composition in a way which doesn't obfuscate your code? I use ($) way

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Cale Gibbard
On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a potential for confusion with function composition (f . g)? That being said, I like this idea (I just need to think it through a bit). I've been wanting this for

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Sebastian Sylvan
On 11/17/05, Cale Gibbard [EMAIL PROTECTED] wrote: On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a potential for confusion with function composition (f . g)? That being said, I like this idea (I just need to

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Greg Woodhouse
--- Cale Gibbard [EMAIL PROTECTED] wrote: Actually, I didn't mention this in the other post, but why not the other way around? Make record selection (#) or (!) (though the latter gets in the way of array access), and leave (.) for function composition. Actually, the fact that (!) is the

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Cale Gibbard
On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Cale Gibbard [EMAIL PROTECTED] wrote: On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a potential for confusion with function composition (f . g)?

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Cale Gibbard
On 17/11/05, Benjamin Franksen [EMAIL PROTECTED] wrote: On Thursday 17 November 2005 19:21, Cale Gibbard wrote: Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Sebastian Sylvan
On 11/17/05, Cale Gibbard [EMAIL PROTECTED] wrote: On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Cale Gibbard [EMAIL PROTECTED] wrote: On 17/11/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 11/17/05, Greg Woodhouse [EMAIL PROTECTED] wrote: Isn't there a

Re: [Haskell-cafe] Project postmortem

2005-11-17 Thread Scotty Weeks
Hi Joel, What would your impression be of building an application in Haskell versus Erlang from a practical point of view given your experiences with this project and the Erlang poker server? My feelings having developed a little with Erlang and embarking on a Haskell project are that

Re: [Haskell-cafe] Project postmortem

2005-11-17 Thread Joel Reymont
On Nov 17, 2005, at 10:59 PM, Scotty Weeks wrote: What would your impression be of building an application in Haskell versus Erlang from a practical point of view given your experiences with this project and the Erlang poker server? I would have been done much faster and with far less

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread John Meacham
another thing is that for any record syntax, we would want higher order versions of the selection, setting, and updating routines. A quick perusal of my source code shows over half my uses of record selectors are in a higher order fashion. (which need to be generated with DrIFT with the current

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Jan-Willem Maessen
On Nov 17, 2005, at 1:52 PM, Benjamin Franksen wrote: ... Yes, yes, yes. I'd rather use a different operator for record selection. For instance the colon (:). Yes, I know it is the 'cons' operator for a certain concrete data type that implements stacks (so called 'lists'). However I am

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread David Menendez
Chris Kuklewicz writes: Would the record system describe at http://lambda-the-ultimate.org/node/view/1119 also be convertable into System Fw, GHC's existing, strongly-typeed intermediate language. ? Probably. Daan's current implementation uses MLF, which I believe is system F implemented for

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Sebastian Sylvan
On 11/18/05, John Meacham [EMAIL PROTECTED] wrote: another thing is that for any record syntax, we would want higher order versions of the selection, setting, and updating routines. A quick perusal of my source code shows over half my uses of record selectors are in a higher order fashion.

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Tomasz Zielonka
On Fri, Nov 18, 2005 at 07:32:53AM +0100, Sebastian Sylvan wrote: On 11/18/05, John Meacham [EMAIL PROTECTED] wrote: map (.foo) xs to pull all the 'foo' fields out of xs. (using made up syntax) Well I suppose this is just a section on the selection operator? So field labels are

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-17 Thread Tomasz Zielonka
On Thu, Nov 17, 2005 at 06:56:09PM +0100, Sebastian Sylvan wrote: Personally I think that the dot is way to good of a symbol to be wasted on function composition. I mean, how often do you really use function composition in a way which doesn't obfuscate your code? I just checked in two recent