-- addDependentFile examples/golden/functions/heap_types/union_const_member.h
-- #include <functions/heap_types/union_const_member.h>
-- void hs_bindgen_8a303cd5b4f7787b (
--   T *arg1,
--   T *arg2
-- )
-- {
--   *arg2 = fun(*arg1);
-- }
-- void hs_bindgen_4e22c71ca196dc5e (
--   T *arg1,
--   T *arg2
-- )
-- {
--   *arg2 = fun(*arg1);
-- }
-- /* test_functionsheap_typesunion_con_Example_get_fun */
-- __attribute__ ((const))
-- T (*hs_bindgen_7e6af500caa71b85 (void)) (
--   T arg1
-- )
-- {
--   return &fun;
-- }
{-| __C declaration:__ @union U@

    __defined at:__ @functions\/heap_types\/union_const_member.h 3:7@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
newtype T
    = T {unwrapT :: ByteArray}
      {- ^ __C declaration:__ @union U@

           __defined at:__ @functions\/heap_types\/union_const_member.h 3:7@

           __exported by:__ @functions\/heap_types\/union_const_member.h@
      -}
deriving via (SizedByteArray 4 4) instance StaticSize T
deriving via (SizedByteArray 4 4) instance ReadRaw T
deriving via (SizedByteArray 4 4) instance WriteRaw T
deriving via (EquivStorable T) instance Storable T
{-|

  __See:__ 'set_t_x'

__C declaration:__ @x@

__defined at:__ @functions\/heap_types\/union_const_member.h 4:13@

__exported by:__ @functions\/heap_types\/union_const_member.h@
-}
get_t_x :: T -> CInt
{-|

  __See:__ 'set_t_x'

__C declaration:__ @x@

__defined at:__ @functions\/heap_types\/union_const_member.h 4:13@

__exported by:__ @functions\/heap_types\/union_const_member.h@
-}
get_t_x = getUnionPayload
{-|

  __See:__ 'get_t_x'

-}
set_t_x :: CInt -> T
{-|

  __See:__ 'get_t_x'

-}
set_t_x = setUnionPayload
instance HasCField T "t_x"
    where type CFieldType T "t_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType T "t_x") =>
         HasField "t_x" (Ptr T) (Ptr ty)
    where getField = fromPtr (Proxy @"t_x")
-- __unique:__ @test_functionsheap_typesunion_con_Example_Safe_fun@
foreign import ccall safe "hs_bindgen_8a303cd5b4f7787b" hs_bindgen_8a303cd5b4f7787b_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesunion_con_Example_Safe_fun@
hs_bindgen_8a303cd5b4f7787b :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesunion_con_Example_Safe_fun@
hs_bindgen_8a303cd5b4f7787b = fromFFIType hs_bindgen_8a303cd5b4f7787b_base
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun :: T -> IO T
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun = \x_0 -> with x_0 (\x_1 -> allocaAndPeek (\res_2 -> hs_bindgen_8a303cd5b4f7787b x_1 res_2))
-- __unique:__ @test_functionsheap_typesunion_con_Example_Unsafe_fun@
foreign import ccall unsafe "hs_bindgen_4e22c71ca196dc5e" hs_bindgen_4e22c71ca196dc5e_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesunion_con_Example_Unsafe_fun@
hs_bindgen_4e22c71ca196dc5e :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesunion_con_Example_Unsafe_fun@
hs_bindgen_4e22c71ca196dc5e = fromFFIType hs_bindgen_4e22c71ca196dc5e_base
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun :: T -> IO T
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun = \x_0 -> with x_0 (\x_1 -> allocaAndPeek (\res_2 -> hs_bindgen_4e22c71ca196dc5e x_1 res_2))
-- __unique:__ @test_functionsheap_typesunion_con_Example_get_fun@
foreign import ccall unsafe "hs_bindgen_7e6af500caa71b85" hs_bindgen_7e6af500caa71b85_base ::
    IO (FunPtr Void)
-- __unique:__ @test_functionsheap_typesunion_con_Example_get_fun@
hs_bindgen_7e6af500caa71b85 :: IO (FunPtr (T -> IO T))
-- __unique:__ @test_functionsheap_typesunion_con_Example_get_fun@
hs_bindgen_7e6af500caa71b85 = fromFFIType hs_bindgen_7e6af500caa71b85_base
{-# NOINLINE fun #-}
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun :: FunPtr (T -> IO T)
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/union_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/union_const_member.h@
-}
fun = unsafePerformIO hs_bindgen_7e6af500caa71b85
