hs-bindgen-1.0.0.0: test-artefacts/fixtures/binding-specs/name/squash_both/th.txt
-- addDependentFile test-artefacts/headers/golden/binding-specs/name/squash_both.h
{-| __C declaration:__ @struct foo@
__defined at:__ @binding-specs\/name\/squash_both.h 1:16@
__exported by:__ @binding-specs\/name\/squash_both.h@
-}
data Hoge
= Hoge {hoge_x :: CInt
{- ^ __C declaration:__ @x@
__defined at:__ @binding-specs\/name\/squash_both.h 1:26@
__exported by:__ @binding-specs\/name\/squash_both.h@
-},
hoge_y :: CInt
{- ^ __C declaration:__ @y@
__defined at:__ @binding-specs\/name\/squash_both.h 1:29@
__exported by:__ @binding-specs\/name\/squash_both.h@
-}}
deriving stock (Eq, Generic, Show)
instance StaticSize Hoge
where staticSizeOf = \_ -> 8 :: Int
staticAlignment = \_ -> 4 :: Int
instance ReadRaw Hoge
where readRaw = \ptr_0 -> (pure Hoge <*> readRaw (Proxy @"hoge_x") ptr_0) <*> readRaw (Proxy @"hoge_y") ptr_0
instance WriteRaw Hoge
where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
Hoge hoge_x_2
hoge_y_3 -> writeRaw (Proxy @"hoge_x") ptr_0 hoge_x_2 >> writeRaw (Proxy @"hoge_y") ptr_0 hoge_y_3
deriving via (EquivStorable Hoge) instance Storable Hoge
deriving via (IsStructViaReadRaw Hoge) instance IsStruct Hoge
instance (~) ty CInt => HasField "hoge_x" Hoge ty
where hasField = \x_0 -> (\y_1 -> Hoge{hoge_x = y_1,
hoge_y = getField @"hoge_y" x_0},
getField @"hoge_x" x_0)
instance (~) ty CInt => HasField "hoge_x" (Ptr Hoge) (Ptr ty)
where getField = fromPtr (Proxy @"hoge_x")
instance HasCField Hoge "hoge_x"
where type CFieldType Hoge "hoge_x" = CInt
offset# = \_ -> \_ -> 0
instance (~) ty CInt => HasField "hoge_y" Hoge ty
where hasField = \x_0 -> (\y_1 -> Hoge{hoge_y = y_1,
hoge_x = getField @"hoge_x" x_0},
getField @"hoge_y" x_0)
instance (~) ty CInt => HasField "hoge_y" (Ptr Hoge) (Ptr ty)
where getField = fromPtr (Proxy @"hoge_y")
instance HasCField Hoge "hoge_y"
where type CFieldType Hoge "hoge_y" = CInt
offset# = \_ -> \_ -> 4