
2 May
2011
2 May
'11
3:35 p.m.
Hi, I tried to access C++ iterators from Haskell via the FFI. There are two example programs attached, in Haskell as well as in C++. Both utilise the same iterator wrapper example.cpp, but when running the Haskell program it prints an empty list, where it should print the contents of some vector. The C++ program meanwhile runs fine though. What does not seem to work is this part: bool finished (std::vector<int>::iterator *begin, std::vector<int>::iterator *end) { return *begin == *end; } In Haskellland, "finished :: Ptr Iterator -> Ptr Iterator -> IO Bool" always returns IO True. Is this a bug lurking in my program or is it a GHC issue? Long