Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Marcin 'Qrczak' Kowalczyk
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] writes: Why is the main thread bound? I can answer myself: if the main thread is unbound, the end of the program can be reached in a different OS thread, which may be a problem if we want to return cleanly to the calling code. I've now implemented a

Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Benjamin Franksen
On Tuesday 01 March 2005 12:20, Marcin 'Qrczak' Kowalczyk wrote: Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] writes: Why is the main thread bound? I can answer myself: if the main thread is unbound, the end of the program can be reached in a different OS thread, which may be a problem if we

Re: [Haskell-cafe] Browser-like UI

2005-03-01 Thread Duncan Coutts
In message [EMAIL PROTECTED] =?ISO-8859-1?Q?Maur=EDcio?= [EMAIL PROTECTED] writes: Hi, I've seen some options for GUI programming in Haskell libraries page, but what I really would like is to define my user interface using HTML (or, maybe, SVG). What are the options to do that in

[Haskell-cafe] Re: Browser-like UI

2005-03-01 Thread MaurĂ­cio
I've seen some options for GUI programming in Haskell libraries page, but what I really would like is to define my user interface using HTML (or, maybe, SVG). What are the options to do that in Haskell? I've read that Gtk2Hs has a mozilla rendering engine, but unfortunatly that won't build

Re: [Haskell-cafe] Numeric vs. relative precedences of infix operators

2005-03-01 Thread Henning Thielemann
On Mon, 28 Feb 2005 [EMAIL PROTECTED] wrote: G'day all. Quoting [EMAIL PROTECTED]: Widely accepted is a widely accepted relativism... I am also annoyed by the precedences 0,1,2, ...,9, etc. Why not 10, 20, 30,... ?? I _think_ we had this back around Haskell 1.1 (which I never used,

Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Marcin 'Qrczak' Kowalczyk
Benjamin Franksen [EMAIL PROTECTED] writes: Producer/consumer ping-pong is 15 times slower between threads running on different OS threads than on two unbound threads. Which OS? Linux/NPTL. A context switch which changes OS threads involves: setitimer pthread_sigmask

Re: [Haskell-cafe] Re: Browser-like UI

2005-03-01 Thread Duncan Coutts
On Tue, 2005-03-01 at 11:15 -0300, MaurĂ­cio wrote: If there are no pre-built packages of gtk2hs for your system you can still build from source in a reasonably straigtforward way. Basically we provide pre-built versions of the problematic files that take so much memory to create in an

Re: [Haskell-cafe] Numeric vs. relative precedences of infix operators

2005-03-01 Thread Benjamin Franksen
On Tuesday 01 March 2005 15:28, Henning Thielemann wrote: On Mon, 28 Feb 2005 [EMAIL PROTECTED] wrote: G'day all. Quoting [EMAIL PROTECTED]: Widely accepted is a widely accepted relativism... I am also annoyed by the precedences 0,1,2, ...,9, etc. Why not 10, 20, 30,... ?? I

[Haskell-cafe] how do I avoid excessive constructor application?

2005-03-01 Thread S. Alexander Jacobson
For some reason, these two functions have different types. fun1 f (Left x)= Left (f x) fun1 _ r@(Right x) = Right x fun2 f (Left x) = Left (f x) fun2 _ r = r Is there a way to rewrite fun2 so that f has type (a-b)? In the general case, it seems wasteful to have to destruct and construct

[Haskell-Cafe] FFI and foreign function returning a structure

2005-03-01 Thread Dimitry Golubovsky
Hi, If I have a C function returning a structure (not a pointer, but structure itself), can this be accomodated via FFI? I re-read the FFI Addendum, and my conclusion is most likely No. I am asking just to make sure this is not only my finding. Dimitry Golubovsky Middletown, CT

Re: [Haskell-cafe] how do I avoid excessive constructor application?

2005-03-01 Thread Ben Lippmeier
S. Alexander Jacobson wrote: For some reason, these two functions have different types. fun1 f (Left x)= Left (f x) fun1 _ r@(Right x) = Right x fun2 f (Left x) = Left (f x) fun2 _ r = r fun1 :: forall a a1 b . (a - a1) - Either a b - Either a1 b fun2 :: forall a b. (a - a) - Either a

Re: [Haskell-Cafe] FFI and foreign function returning a structure

2005-03-01 Thread Ben Lippmeier
Dimitry Golubovsky wrote: Hi, If I have a C function returning a structure (not a pointer, but structure itself), can this be accomodated via FFI? No. The way data is organised in memory is dramatically different in Haskell when compared with C. You need to write functions to read in each field

Re: [Haskell-Cafe] FFI and foreign function returning a structure

2005-03-01 Thread shelarcy
I think this is relation to my problem. (B (BI wnant to write Haskell interface to FFmpeg. So first, I try to port (Boutput_example.c to Haskell. But output_example.c's wants to initialize (Bstructure like this, (B (B (Bvoid write_audio_frame(AVFormatContext *oc, AVStream *st) (B{ (B