
28 Apr
2008
28 Apr
'08
8:11 a.m.
Hi, I am calling a Haskell function from my C code, wherein I export a Haskell function xyz that takes as an argument string and returns a string: Foreign export ccall xyz::CString -> IO CString xyz = do -- extract the input string and act on it-- -- at the end I return a string like this newCString str Now once I call this function from C code, I am freeing the allocated memory using free function. I want to confirm that this is the right thing to do. - Anurag