[Haskell-cafe] Newbie Question: Using Haskell Functions in a C Program

Don Stewart dons at galois.com
Thu May 8 19:12:15 EDT 2008


mail:
> Thanks for all the answers. I'm testing this right now and simples 
> cases work as expected. However from what I've read it seems it'll 
> get ugly once I try to pass a C array to a Haskell function.

Right, passing arrays back and forth is going to get tiring.
  
> Well, maybe arrays in C have been ugly before trying to pass them to 
> Haskell functions ;)
> 
> To elaborate a bit about the C program, it's a small game using 
> OpenGL for output and mouse and keyboard for input.
> I just don't know how to do that in Haskell - my knowledge is quite 
> basic in nature ;)

Oh, then you'll want to use the Haskell OpenGL bindings.

    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/OpenGL

There's a few OpenGL-based games in Haskell, here:

    http://haskell.org/haskellwiki/Applications_and_libraries/Games

and a section of blog articles on using the OpenGL bindings:

    http://haskell.org/haskellwiki/Blog_articles/Graphics#OpenGL

-- Don


More information about the Haskell-Cafe mailing list