Re: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread SevenThunders
Yup I'm aware of it, and I'd love to use it. The only problem is that it's highly linux/unix specific as far as I can tell. Even the graphics libraries it uses only runs on 'nix right now. I just tried to load graphics.hgl and hello world program crashed GHCi and doesn't compile under the regul

RE: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread Tim Newsham
Matthew, the entire Haskell.org website is a Wiki. You might spare someone else the pain that you went through by starting a "Duffers guide to the Haskell FFI" that contains the information you wished you'd known on day 1. I'm sure you'd get lots of help on the #haskell IRC if you did so. The

RE: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread Donn Cave
On Mon, 15 May 2006, Simon Peyton-Jones wrote: > | > the automated ones, seemed to handle the case of passing numerical > | > arrays to C, and having them get updated and passed back. That is > my > | > primary interest in the FFI and yet no obvious solution or example > | > could be found after d

Re[2]: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread Bulat Ziganshin
Hello Donald, Saturday, May 13, 2006, 11:47:34 AM, you wrote: > * Visit haskell.org > * Click on "Books and tutorials" > * Scroll to "Using Monads" > * First entry in the list is this paper. but novices don't know what monads is a Haskell way to do I/O and interface with C! >> It was ce

Re: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread Henning Thielemann
On Sat, 13 May 2006, Matthew Bromberg wrote: > So after about 10 hours of wrestling with syntax, including messing up > the initial capitalization of module names, indenting in do lists, > forgetting to put commas in tuples and lists I finally got the following > example to compile without error

RE: [Haskell-cafe] Troubles with FFI

2006-05-15 Thread Simon Peyton-Jones
| > the automated ones, seemed to handle the case of passing numerical | > arrays to C, and having them get updated and passed back. That is my | > primary interest in the FFI and yet no obvious solution or example | > could be found after days of internet searching and pouring over | > tutorials

Re: [Haskell-cafe] Troubles with FFI

2006-05-13 Thread Brian Hulley
Brian Hulley wrote: withStorableArray arr $ sumarr >>= print Ooops! (withStorableArray arr sumarr) >>= print ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Troubles with FFI

2006-05-13 Thread Brian Hulley
Matthew Bromberg wrote: foreign import ccall "matrix_c.h sumarr" sumarr :: Ptr CDouble -> CDouble [snip] If one changes the array in[] in the C code, e.g. double sumarr(double *in) { in[0] = -10.0 ; return(in[0] + in[1]) ; } The array is changed inside the haskell program as a side effect. mai

Re: [Haskell-cafe] Troubles with FFI

2006-05-13 Thread Donald Bruce Stewart
mattcbro: > I am a newcomer to Haskell and I'm offering my perspective on the troubles I > endured trying to make Haskell interface to some simple C programs. > It is my hope, that by documenting this, someone else will benefit from my > mistakes and errors and climb the learning curve somewhat fas

[Haskell-cafe] Troubles with FFI

2006-05-13 Thread Matthew Bromberg
I am a newcomer to Haskell and I'm offering my perspective on the troubles I endured trying to make Haskell interface to some simple C programs. It is my hope, that by documenting this, someone else will benefit from my mistakes and errors and climb the learning curve somewhat faster than me. I w