Re: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Anatoly Yakovenko
>> I have not been following the details, but would you consider writing up >> your example on the GHC user guide Wiki? >>http://haskell.org/haskellwiki/GHC/Using_the_FFI >> >> It's a very good way to share your experience with others. > > I got that example from Claude Heiland-Allen. Unl

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Anatoly Yakovenko
> I have not been following the details, but would you consider writing up your > example on the GHC user guide Wiki? >http://haskell.org/haskellwiki/GHC/Using_the_FFI > > It's a very good way to share your experience with others. I got that example from Claude Heiland-Allen. Unless he h

RE: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Simon Peyton-Jones
EMAIL PROTECTED] [mailto:haskell-cafe- | [EMAIL PROTECTED] On Behalf Of Anatoly Yakovenko | Sent: 24 September 2008 22:42 | To: [EMAIL PROTECTED] | Cc: haskell | Subject: Re: [Haskell-cafe] Injecting Haskell into C | | you'll find this example really helpfull | | | -- Forward

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Evan Laforge
> As I understand, there are two ways to do that. Either Haskell code is > called from C, or C code is called for Haskell. So my questions are: > 1. Are they both possible? Yep. > 2. If yes, which is better performance-wise? (C function is > performance-critical). If generated function is calle

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Anatoly Yakovenko
you'll find this example really helpfull -- Forwarded message -- From: Claude Heiland-Allen <[EMAIL PROTECTED]> Date: 2008/6/5 Subject: Re: [Haskell-cafe] example of FFI FunPtr To: "Galchin, Vasili" <[EMAIL PROTECTED]> Cc: haskell Galchin, Vasili wrote: > > Hello, > > I w

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Bulat Ziganshin
Hello Roman, Wednesday, September 24, 2008, 2:04:38 PM, you wrote: > As I understand, there are two ways to do that. Either Haskell code is > called from C, or C code is called for Haskell. So my questions are: > 1. Are they both possible? yes. "foreign export" exports Haskell functions to C wor

[Haskell-cafe] Injecting Haskell into C

2008-09-24 Thread Roman Cheplyaka
I have a C function whose behaviour is customized by user-supplied function (think of libc qsort). Typically these user-supplied functions are written in C, but I'd like to use FFI to write them in Haskell. Precisely, I'd like to write high-order function which will generate these functions (e.g. m