15 lines
425 B
Haskell
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
|