garnet/haskell/exe/Main.hs
2026-02-19 16:29:52 +00:00

15 lines
425 B
Haskell

module Main (main) where
import Data.ByteString
import Foreign.C
import GarnetRs
import GarnetRs.Safe
import HsBindgen.Runtime.PtrConst
main :: IO ()
main = do
useAsCString "Haskell" $ hello . unsafeFromPtr
hello_struct T{a = CBool 1, b = 42}
hello_shape $ Shape (Shape_Tag 0) $ set_shape_body_circle $ Circle_Body 3.14
hello_shape $ Shape (Shape_Tag 1) $ set_shape_body_rectangle $ Rectangle_Body 10.0 5.0