Thanks, this worked great.  Just a few seconds to link in a 5M
tarball.  Details:


test.s:

.global test_data
test_data:
.byte 0
.byte 1
.byte 2
...


Foo.hs:

import Foreign
import Data.ByteString.Internal
import Data.Word
import System.IO.Unsafe

foreign import ccall "&" test_data :: Ptr Word8

test :: ByteString
test = fromForeignPtr (unsafePerformIO (newForeignPtr_ test_data)) 0
lengthOfTestData


Compiled with:

ghc --make -W -fglasgow-exts -o something test.s ...
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to