
6 Dec
2010
6 Dec
'10
11:43 a.m.
On Sun, Dec 5, 2010 at 12:45 PM, Lally Singh
Is that how it's intended?
I think that's correct, (it at least fits the pattern for 'with' functions in Haskell). They're idiomatically used with syntax like this:
buildReaderFun :: String -> CodeGenModule (Function (IO ())) buildReaderFun nm = do puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32) withStringNul nm $ \greetz -> createFunction ExternalLinkage $ do tmp <- getElementPtr greetz (0 :: Word32,(0 :: Word32, ())) call puts tmp -- Throw away return value. ret ()