Re: compiling concurrent haskell with ghc

2003-07-28 Thread Keith Wansbrough
Hi all, I have a question on compiling a concurrent haskell source code using GHC. Today is my first time playing around with concurrency in Haskell, and this afternoon, GHC seemed to be able to compile my code and produced an executable. However, that executable did not seem to run the

Re: compiling concurrent haskell with ghc

2003-07-28 Thread Dennis Sidharta
Hi Keith, With this email I attached the source code. As you can see, it is very simple. And in case you would like to know, I wrote that program for a short tutorial on Haskell for a programming language courseI took last semester. Thank you very much. Blessings, Dennis Keith Wansbrough

Re: Type design question

2003-07-28 Thread Konrad Hinsen
On Friday 25 July 2003 21:48, Dylan Thurston wrote: Another approach is to make Universe a multi-parameter type class: class (RealFrac a, Floating a) = Universe u a | u - a where distanceVector :: u - Vector a - Vector a - Vector a ... You need to use ghc with '-fglasgow-exts' for this.

Re: compiling concurrent haskell with ghc

2003-07-28 Thread Sven Panne
Dennis Sidharta wrote: [ problems with concurrent Haskell ] I can see two problems in your code: * forkIO creates daemon threads, so the program terminates immediately. * Chan is an unbounded channel, so you won't get a ping pong, which is probably what you expected. MVar is your friend here.

Re: Type design question

2003-07-28 Thread Mark Carroll
On Mon, 28 Jul 2003, Konrad Hinsen wrote: What is the general attitude in the Haskell community towards compiler-specific extensions? My past experience with Fortran and C/C++ tells me to stay away from them. Portability is an important criterion for me. It depends which ones. Some are

Re: Type design question

2003-07-28 Thread Derek Elkins
On Mon, 28 Jul 2003 09:54:11 -0400 (EDT) Mark Carroll [EMAIL PROTECTED] wrote: It would be interesting to see a list of what people think will make it into Haskell 2 though. http://haskell.org/hawiki/HaskellTwo ___ Haskell-Cafe mailing list [EMAIL

Re: Type design question

2003-07-28 Thread Dylan Thurston
On Mon, Jul 28, 2003 at 03:42:11PM +0200, Konrad Hinsen wrote: On Friday 25 July 2003 21:48, Dylan Thurston wrote: Another approach is to make Universe a multi-parameter type class: class (RealFrac a, Floating a) = Universe u a | u - a where distanceVector :: u - Vector a - Vector a -

Re: Type design question

2003-07-28 Thread Graham Klyne
At 15:40 28/07/03 +0200, Konrad Hinsen wrote: This is beginning to get a little ugly, but I think that's largely because you're using type classes in too much of an OO style (this is I am coming from OO indeed... Me too. Twice now I have used Haskell classes in a way suggested by an OO

Re: compiling concurrent haskell with ghc

2003-07-28 Thread Dennis Sidharta
Hi Sven, Thanks for the pointer! I will try to play around with MVar. Sincerely, DennisSven Panne [EMAIL PROTECTED] wrote: Dennis Sidharta wrote: [ problems with concurrent Haskell ]I can see two problems in your code:* forkIO creates "daemon threads", so the program terminates immediately.*