3 Mar 2004 03:04
Trouble with [in,string]char* with hdirect
Vincenzo aka Nick Name <vincenzo_mlRE.MOVE <at> yahoo.it>
2004-03-03 02:04:43 GMT
2004-03-03 02:04:43 GMT
Hi all,
I am experimenting with hdirect for the first time, and I can't figure
out how to call an haskell function of type String -> IO Int from C. I
already can compile and use a function of type Char -> IO Int, so I
assume to be using the right command line arguments.
I have, in Math.idl
----
module Math {
int munlink([in,string]char *s);
};
----
in Math.hs
----
module Math where
munlink :: String -> IO Int
munlink s = putStr ("Hey!" ++ s ++ "\n") >> return (-1)
----
This is the generated .hs file:
module MathProxy where
import Prelude (fromEnum, toEnum)
import qualified Prelude
(Continue reading)
RSS Feed