[GUI] Example: Binding C++ to Haskell using the ffi
David Sankel
camio@yahoo.com
Sat, 1 Mar 2003 13:44:29 -0800 (PST)
--0-207792226-1046555069=:24659
Content-Type: text/plain; charset=us-ascii
Content-Id:
Content-Disposition: inline
Sorry, forgot attachment . . . again. :-P
--
Here is some example code doing just that. It uses
ghc.
Questions:
Can one think of better ways to interface generic c++
libraries to Haskell? What do you think of the ->>
member function operator?
for the ffi people:
Has any though gone into cplusplus? If so, how would
it interface? Would stubs on the c++ side be
generated or would it use the code directly.
Later,
David J. Sankel
--0-207792226-1046555069=:24659
Content-Type: application/octet-stream; name="fooble2.tar.bz2"
Content-Transfer-Encoding: base64
Content-Description: fooble2.tar.bz2
Content-Disposition: attachment; filename="fooble2.tar.bz2"
QlpoOTFBWSZTWVcorJ4ADer///6/+uL+//+f/3///v//3+uDeBEQBkeAIH2h
yc6stXdK4AyO+RrNL1zqABQqQSiSAAaAA0ACDEpqSfpR+qDTR+pPUaGjAgaZ
GTTIyDTCaAAAZBhGI00wjEADEaaYmTTTTJp6n6oQZMIMgGhiDJpoyYCMCMmm
TQ0YgxGTAJo0BoyBiGmE0yNNGgZMmTABxGjTRgTI0wmmRoZDTTCGJiMEZABk
DIaMhkMhkAwjTTARgAJkNDBJqRKniaRqeiNG1AAG1DTRkep6jIAAAAZAZDRo
0AABo0AAGgyABogyYQZANDEGTTRkwEYEZNMmhoxBiMmATRoDRkDENMJpkaaN
AyZMmABIiCCACaDUaAm0g1T1ANkT9UAABo0AGgDQMg0xDRoA2kANAANqepPk
f0FiF1SCkR3SGFkDYJm7LWnEYSqO7ahJFGnG1hGSXRVOGqoQMuVctgIB28GE
1zoJF9jQ3wQwXtwjvLq5+8jX0toxhMjKHCQB8ZMAwwZhKQgDqaG52HwHJNMJ
RLhqExENYTJGQdHV5avfFrYWxXWqSUJjYFCNhGqqqKGoTyebsd7C+GZUq+5M
1qww1qTDMuWG7dta7RZLwjLWqSxVVZaotVQuhJJM1JAIuVqBCBUColZqpXDj
Oe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