Use ByteString

This commit is contained in:
George Thomas 2026-02-19 11:11:54 +00:00
parent 7e09c1d681
commit 5f1e49c4ce
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
module Main (main) where
import Data.ByteString
import Foreign
import Foreign.C
import GarnetRs
@ -9,7 +10,7 @@ import HsBindgen.Runtime.PtrConst
main :: IO ()
main = do
withCString "Haskell" $ hello . unsafeFromPtr
useAsCString "Haskell" $ hello . unsafeFromPtr
alloca \ptr -> do
writeRaw ptr T{a = CBool 1, b = 42}
hello_struct (unsafeFromPtr ptr)

View File

@ -48,5 +48,6 @@ executable garnet
-with-rtsopts=-N
build-depends:
base >= 4.14,
bytestring,
garnet-generated,
hs-bindgen-runtime,