Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Evan Martin
On 7/21/06, Taral <[EMAIL PROTECTED]> wrote: On 7/20/06, Evan Martin <[EMAIL PROTECTED]> wrote: > The tricky part is that to pass in Haskell functions, I need to use > the FFI "wrapper" import, which means I need to later free them. But > the only place I can free them is within the "free" callb

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Anatoly Zaretsky
On 7/20/06, Evan Martin <[EMAIL PROTECTED]> wrote: To elaborate, the code setting this up looks something like this: callback_fcn <- ... -- get a FunPtr using "wrapper" from the ffi free_fcn <- ... -- as above -- the callback data is just stuff that needs freeing callback_data <- newStabl

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Taral
On 7/20/06, Evan Martin <[EMAIL PROTECTED]> wrote: The tricky part is that to pass in Haskell functions, I need to use the FFI "wrapper" import, which means I need to later free them. But the only place I can free them is within the "free" callback, and I've just discovered this isn't allowed!

Re: [Haskell] rigid variables

2006-07-20 Thread David Roundy
On Thu, Jul 20, 2006 at 10:48:02AM -0600, Rodney D Price wrote: > > I've gotten this sort of error several times, which mysteriously > disappears when I add more functions to the code: > > storeError.hs:13:38: > Couldn't match expected type `a' (a rigid variable) >against inferr

[Haskell] rigid variables

2006-07-20 Thread Rodney D Price
I've gotten this sort of error several times, which mysteriously disappears when I add more functions to the code: storeError.hs:13:38: Couldn't match expected type `a' (a rigid variable) against inferred type `String' `a' is bound by the type signature for `throwError'

[Haskell] Re: using the ffi with callbacks

2006-07-20 Thread Simon Marlow
Evan Martin wrote: Suppose I have a C function like this: void register_callback( void (*callback_fcn)(void *data), void *callback_data, void (*free_fcn)(void *data)); I think this is pretty common in C libraries. The idea is that you can register a callback along with a pointer to som

[Haskell] using the ffi with callbacks

2006-07-20 Thread Evan Martin
Suppose I have a C function like this: void register_callback( void (*callback_fcn)(void *data), void *callback_data, void (*free_fcn)(void *data)); I think this is pretty common in C libraries. The idea is that you can register a callback along with a pointer to some data to pass to it

Re: [Haskell] semantice of seq

2006-07-20 Thread voigt . 16734551
--- [EMAIL PROTECTED] wrote: > Do you have an example of use of seq on a function type? (Of course I > don't want to ban it, just change its behaviour.) I don't have any wisdom to offer on how we would want to ban or change the behavior of seq on a function type without using type classes. Nor

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Wed, 19 Jul 2006, Duncan Coutts wrote: Ah ok, I misunderstood. Well that'd be a bit odd too. No other function behaves differently on different types except by use of type classes. I agree it is quite odd, but the seq we have is already quite odd. Furthermore, the fact is that seq on func

Re: [Haskell] semantice of seq

2006-07-20 Thread Duncan Coutts
On Wed, 2006-07-19 at 08:09 -0400, [EMAIL PROTECTED] wrote: > On Tue, 18 Jul 2006, Duncan Coutts wrote: > > > On Tue, 2006-07-18 at 09:44 -0400, [EMAIL PROTECTED] wrote: > >> Would the problematic semantics of seq be resolved if seq did nothing on > >> function types? That is to say > >> > >> seq

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Tue, 18 Jul 2006, Duncan Coutts wrote: On Tue, 2006-07-18 at 09:44 -0400, [EMAIL PROTECTED] wrote: Would the problematic semantics of seq be resolved if seq did nothing on function types? That is to say seq (\x -> undefined `asTypeOf` x) y reduced to y and seq (undefined `asTypeOf` id) y

[Haskell] CFP: IEEE ICDM'06 Workshops

2006-07-20 Thread Jia Hu
[Apologies if you receive this more than once] == Call for Workshop Papers ICDM'06: The 6th IEEE International Conference on Data Mining Hong Kong Convention and Exhibition Centre, Hong Kong, China, 18-22 December 2006 Sponsored by

[Haskell] CFP: IEEE/WIC/ACM WI-IAT'06 Workshops

2006-07-20 Thread Jia Hu
[Apologies if you receive this more than once] == Call for Workshop Papers 2006 IEEE/WIC/ACM International Joint Conference on Web Intelligence and Intelligent Agent Technology (WI-IAT'06) Hong Kong Convention and Exhibition Centre, Hon