Crash Course for C++ "Refugees"?

Hi, I have recently been introduced to Haskell and find it quite fascinating. I am interested in incorporating it into a C++ project on which I am working, porting pieces of that program to Haskell when practical. Is Anyone able to point Me in the direction of a "crash course" or "quick start" guide for Anyone used to programming in C++ seeking to call Haskell code from the C++ portion and/or vice versa? I am especially interested in knowing how to pass information from, say, the C++ standard template library containers (e.g., vector, valarray, etc.) and into Haskell functions/methods/procedures/etc. While I might have missed such information when I performed a web search on the topic, I did not find any information to help. Any assistance in finding such material would be greatly appreciated. Sincerely, Frank D. Martinez -- P.S.: I prefer to be reached on BitMessage at BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6

Hi Frank,
You are looking for the foreign function interface (FFI) for Haskell.
Googling this will produce no end of _somewhat_ useful results. Basically
you can call Haskell from C and vice versa. I'm not aware of a hs ffi
explicitly for C++, but it is essentially the same/likely short work to do
the C<->C++ interface for any particular application.
http://www.haskell.org/haskellwiki/FFI_Introduction
http://www.haskell.org/haskellwiki/GHC/Using_the_FFI
There is some code that I wrote for an abandoned project that might help
you out at lotusstem.us/ffi.zip (sorry for the random site, the code
somehow ended up on that server and I'm without a laptop to easily move it
now). If i remember correctly I had issues with hsFFI.h so just avoided
using it entirely. Likely not the correct approach but hopefully enough to
get you started.
Mark
On Aug 13, 2014 1:20 PM, "Frank"
Hi, I have recently been introduced to Haskell and find it quite fascinating. I am interested in incorporating it into a C++ project on which I am working, porting pieces of that program to Haskell when practical. Is Anyone able to point Me in the direction of a "crash course" or "quick start" guide for Anyone used to programming in C++ seeking to call Haskell code from the C++ portion and/or vice versa? I am especially interested in knowing how to pass information from, say, the C++ standard template library containers (e.g., vector, valarray, etc.) and into Haskell functions/methods/procedures/etc. While I might have missed such information when I performed a web search on the topic, I did not find any information to help. Any assistance in finding such material would be greatly appreciated.
Sincerely, Frank D. Martinez
-- P.S.: I prefer to be reached on BitMessage at BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

I think the last part of "Tackling the Awkward Squad" is a good intro to the foreign function interface. http://research.microsoft.com/en-us/um/people/simonpj/papers/marktoberdorf/ Dimitri Em 13/08/14 11:19, Frank escreveu:
Hi, I have recently been introduced to Haskell and find it quite fascinating. I am interested in incorporating it into a C++ project on which I am working, porting pieces of that program to Haskell when practical. Is Anyone able to point Me in the direction of a "crash course" or "quick start" guide for Anyone used to programming in C++ seeking to call Haskell code from the C++ portion and/or vice versa? I am especially interested in knowing how to pass information from, say, the C++ standard template library containers (e.g., vector, valarray, etc.) and into Haskell functions/methods/procedures/etc. While I might have missed such information when I performed a web search on the topic, I did not find any information to help. Any assistance in finding such material would be greatly appreciated.
Sincerely, Frank D. Martinez
-- P.S.: I prefer to be reached on BitMessage at BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Wed, 13 Aug 2014 19:19:12 +0200, Frank
Is Anyone able to point Me in the direction of a "crash course" or "quick start" guide for Anyone used to programming in C++ seeking to call Haskell code from the C++ portion and/or vice versa? I am especially interested in knowing how to pass information from, say, the C++ standard template library containers (e.g., vector, valarray, etc.) and into Haskell functions/methods/procedures/etc. While I might have missed such information when I performed a web search on the topic, I did not find any information to help. Any assistance in finding such material would be greatly appreciated.
wxHaskell uses C to bind to wxWidgets, which is written in C++. See for instance: https://github.com/wxHaskell/wxHaskell/blob/master/wxc/src/cpp/wrapper.cpp A short introduction how to write a C wrapper can be found at: http://wewantarock.wordpress.com/2012/01/12/who-is-my-community/ look for "Wrapping C++ for beginners" Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
participants (4)
-
Dimitri DeFigueiredo
-
Frank
-
Henk-Jan van Tuyl
-
Mark Santolucito