garnet/haskell/exe/Main.hs

15 lines
425 B
Haskell
Raw Normal View History

2026-02-17 14:57:34 +00:00
module Main (main) where
2026-02-19 11:11:54 +00:00
import Data.ByteString
import Foreign.C
2026-02-19 11:11:23 +00:00
import GarnetRs
import GarnetRs.Safe
import HsBindgen.Runtime.PtrConst
2026-02-17 14:57:34 +00:00
main :: IO ()
main = do
2026-02-19 11:11:54 +00:00
useAsCString "Haskell" $ hello . unsafeFromPtr
2026-02-19 11:15:38 +00:00
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