7 Jul
2007
7 Jul
'07
11:50 p.m.
First of all, I'm wondering what the intended uses of the lookupCType and lookupCType' functions are. It seems like lookupCType tells you the type that should be used in marshalling a type, and lookupCType tells you the primitive type that is used in the representation of a type as well as how to extract the value from it. I'm not sure how to go from there to actually converting to/from the correct primitive type to use in interfacing with C code... Another question is: what sort of E type should an imperative foreign export use? Consider: foreign export hello :: Int -> IO () hello n = putStrLn ("Hello, "++show n) foreign export foo :: IO Int foo :: Num a => IO a foo = return 1 Should they just use IO? I guess that's what main does...