
Please, I just can not figure this out: I have a method in my C dll: int somemethod(char *param, int length, double array[], int UB1, int UB2, bool isValid); I would like to use this method in Haskell, so I have defined it like: {-# OPTIONS_GHC -fglasgow-exts #-} import Foreign import Foreign.C foreign import stdcall unsafe "somemethod" c_somemethod :: Ptr CString -> Int -> Ptr (Double) -> Int -> Int -> Bool -> IO Int main = do let param = ["input"] let paramLength = length param realTable = [ 1.0, 2.0, 3.0 ] :: [Double] ub1 = 0 ub2 = 2 isValid = False realTablePtr <- newArray realTable x <- c_somemethod param paramLength realTablePtr ub1 ub2 isValid free realTablePtr putStrLn $ "c_somemethod output: " ++ show x putStrLn "Done" When I try to compile this I get error regarding the param string. I have no idea how to define it. Additionally to this, is the freeing of realTablePtr correct? compile error: Couldn't match expected type `Ptr CString' with actual type `[t0]' In the first argument of `c_somemethod', namely `param' Please, how can I ix this? cheers, m.