{-# LANGUAGE ForeignFunctionInterface #-} #include #include module OpenCVRaw.CppTypes where #strict_import {- Provides wrappers for core c++ types that Haskell doesn't have access to - but opencv requires. -} import OpenCVRaw.Types import Foreign.C import Foreign.C.Types import Foreign.Ptr #ccall std_create_string , CString -> CInt -> IO (Ptr ) #ccall std_create_vector_int , Ptr CInt -> CSize -> IO (Ptr ) toStdString :: String -> IO (Ptr C'string) toStdString s = do (cs, l) <- newCStringLen s c'std_create_string cs (fromIntegral l)