-- addDependentFile examples/golden/binding-specs/fun_arg/macro/enum.h
-- #include <binding-specs/fun_arg/macro/enum.h>
-- void hs_bindgen_d49a011eb7da5969 (
--   enum MyEnum arg1
-- )
-- {
--   foo(arg1);
-- }
-- void hs_bindgen_32c6f6f9bb440690 (
--   A arg1
-- )
-- {
--   fooA(arg1);
-- }
-- void hs_bindgen_16e7856908d06f71 (
--   B arg1
-- )
-- {
--   fooB(arg1);
-- }
-- void hs_bindgen_0e6b98e93cad73ef (
--   enum MyEnum arg1
-- )
-- {
--   foo(arg1);
-- }
-- void hs_bindgen_1c6de1b89014dc52 (
--   A arg1
-- )
-- {
--   fooA(arg1);
-- }
-- void hs_bindgen_a8e579f3b5035c03 (
--   B arg1
-- )
-- {
--   fooB(arg1);
-- }
-- /* test_bindingspecsfun_argmacroen_Example_get_foo */
-- __attribute__ ((const))
-- void (*hs_bindgen_098964a440956602 (void)) (
--   enum MyEnum arg1
-- )
-- {
--   return &foo;
-- }
-- /* test_bindingspecsfun_argmacroen_Example_get_fooA */
-- __attribute__ ((const))
-- void (*hs_bindgen_86b685b9d27ce50e (void)) (
--   A arg1
-- )
-- {
--   return &fooA;
-- }
-- /* test_bindingspecsfun_argmacroen_Example_get_fooB */
-- __attribute__ ((const))
-- void (*hs_bindgen_9383ae52414c2c19 (void)) (
--   B arg1
-- )
-- {
--   return &fooB;
-- }
{-| __C declaration:__ @enum MyEnum@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 4:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
newtype MyEnum
    = MyEnum {unwrapMyEnum :: CUInt}
      {- ^ __C declaration:__ @enum MyEnum@

           __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 4:6@

           __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
      -}
    deriving stock (Eq, Ord)
    deriving newtype HasFFIType
instance StaticSize MyEnum
    where staticSizeOf = \_ -> 4 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw MyEnum
    where readRaw = \ptr_0 -> pure MyEnum <*> readRawByteOff ptr_0 (0 :: Int)
instance WriteRaw MyEnum
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       MyEnum unwrapMyEnum_2 -> writeRawByteOff ptr_0 (0 :: Int) unwrapMyEnum_2
deriving via (EquivStorable MyEnum) instance Storable MyEnum
deriving via CUInt instance Prim MyEnum
instance CEnum MyEnum
    where type CEnumZ MyEnum = CUInt
          toCEnum = MyEnum
          fromCEnum = unwrapMyEnum
          declaredValues = \_ -> declaredValuesFromList [(0, singleton "X")]
          showsUndeclared = showsWrappedUndeclared "MyEnum"
          readPrecUndeclared = readPrecWrappedUndeclared "MyEnum"
          isDeclared = seqIsDeclared
          mkDeclared = seqMkDeclared
instance SequentialCEnum MyEnum
    where minDeclaredValue = X
          maxDeclaredValue = X
instance Show MyEnum
    where showsPrec = shows
instance Read MyEnum
    where readPrec = readPrec
          readList = readListDefault
          readListPrec = readListPrecDefault
instance TyEq ty (CFieldType MyEnum "unwrapMyEnum") =>
         HasField "unwrapMyEnum" (Ptr MyEnum) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapMyEnum")
instance HasCField MyEnum "unwrapMyEnum"
    where type CFieldType MyEnum "unwrapMyEnum" = CUInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @x@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 4:14@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
pattern X :: MyEnum
{-| __C declaration:__ @x@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 4:14@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
pattern X = MyEnum 0
{-| __C declaration:__ @A@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 7:9@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
newtype A
    = A {unwrapA :: MyEnum}
      {- ^ __C declaration:__ @A@

           __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 7:9@

           __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim)
instance TyEq ty (CFieldType A "unwrapA") =>
         HasField "unwrapA" (Ptr A) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapA")
instance HasCField A "unwrapA"
    where type CFieldType A "unwrapA" = MyEnum
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @B@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 8:9@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
newtype B
    = B {unwrapB :: A}
      {- ^ __C declaration:__ @B@

           __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 8:9@

           __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim)
instance TyEq ty (CFieldType B "unwrapB") =>
         HasField "unwrapB" (Ptr B) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapB")
instance HasCField B "unwrapB"
    where type CFieldType B "unwrapB" = A
          offset# = \_ -> \_ -> 0
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_foo@
foreign import ccall safe "hs_bindgen_d49a011eb7da5969" hs_bindgen_d49a011eb7da5969_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_foo@
hs_bindgen_d49a011eb7da5969 :: MyEnum -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_foo@
hs_bindgen_d49a011eb7da5969 = fromFFIType hs_bindgen_d49a011eb7da5969_base
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo :: MyEnum -> IO Unit
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo = hs_bindgen_d49a011eb7da5969
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooA@
foreign import ccall safe "hs_bindgen_32c6f6f9bb440690" hs_bindgen_32c6f6f9bb440690_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooA@
hs_bindgen_32c6f6f9bb440690 :: A -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooA@
hs_bindgen_32c6f6f9bb440690 = fromFFIType hs_bindgen_32c6f6f9bb440690_base
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA :: A -> IO Unit
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA = hs_bindgen_32c6f6f9bb440690
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooB@
foreign import ccall safe "hs_bindgen_16e7856908d06f71" hs_bindgen_16e7856908d06f71_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooB@
hs_bindgen_16e7856908d06f71 :: B -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Safe_fooB@
hs_bindgen_16e7856908d06f71 = fromFFIType hs_bindgen_16e7856908d06f71_base
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB :: B -> IO Unit
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB = hs_bindgen_16e7856908d06f71
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_foo@
foreign import ccall unsafe "hs_bindgen_0e6b98e93cad73ef" hs_bindgen_0e6b98e93cad73ef_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_foo@
hs_bindgen_0e6b98e93cad73ef :: MyEnum -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_foo@
hs_bindgen_0e6b98e93cad73ef = fromFFIType hs_bindgen_0e6b98e93cad73ef_base
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo :: MyEnum -> IO Unit
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo = hs_bindgen_0e6b98e93cad73ef
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooA@
foreign import ccall unsafe "hs_bindgen_1c6de1b89014dc52" hs_bindgen_1c6de1b89014dc52_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooA@
hs_bindgen_1c6de1b89014dc52 :: A -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooA@
hs_bindgen_1c6de1b89014dc52 = fromFFIType hs_bindgen_1c6de1b89014dc52_base
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA :: A -> IO Unit
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA = hs_bindgen_1c6de1b89014dc52
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooB@
foreign import ccall unsafe "hs_bindgen_a8e579f3b5035c03" hs_bindgen_a8e579f3b5035c03_base ::
    Word32
 -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooB@
hs_bindgen_a8e579f3b5035c03 :: B -> IO Unit
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_Unsafe_fooB@
hs_bindgen_a8e579f3b5035c03 = fromFFIType hs_bindgen_a8e579f3b5035c03_base
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB :: B -> IO Unit
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB = hs_bindgen_a8e579f3b5035c03
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_foo@
foreign import ccall unsafe "hs_bindgen_098964a440956602" hs_bindgen_098964a440956602_base ::
    IO (FunPtr Void)
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_foo@
hs_bindgen_098964a440956602 :: IO (FunPtr (MyEnum -> IO Unit))
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_foo@
hs_bindgen_098964a440956602 = fromFFIType hs_bindgen_098964a440956602_base
{-# NOINLINE foo #-}
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo :: FunPtr (MyEnum -> IO Unit)
{-| __C declaration:__ @foo@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 5:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
foo = unsafePerformIO hs_bindgen_098964a440956602
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooA@
foreign import ccall unsafe "hs_bindgen_86b685b9d27ce50e" hs_bindgen_86b685b9d27ce50e_base ::
    IO (FunPtr Void)
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooA@
hs_bindgen_86b685b9d27ce50e :: IO (FunPtr (A -> IO Unit))
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooA@
hs_bindgen_86b685b9d27ce50e = fromFFIType hs_bindgen_86b685b9d27ce50e_base
{-# NOINLINE fooA #-}
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA :: FunPtr (A -> IO Unit)
{-| __C declaration:__ @fooA@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 10:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooA = unsafePerformIO hs_bindgen_86b685b9d27ce50e
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooB@
foreign import ccall unsafe "hs_bindgen_9383ae52414c2c19" hs_bindgen_9383ae52414c2c19_base ::
    IO (FunPtr Void)
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooB@
hs_bindgen_9383ae52414c2c19 :: IO (FunPtr (B -> IO Unit))
-- __unique:__ @test_bindingspecsfun_argmacroen_Example_get_fooB@
hs_bindgen_9383ae52414c2c19 = fromFFIType hs_bindgen_9383ae52414c2c19_base
{-# NOINLINE fooB #-}
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB :: FunPtr (B -> IO Unit)
{-| __C declaration:__ @fooB@

    __defined at:__ @binding-specs\/fun_arg\/macro\/enum.h 11:6@

    __exported by:__ @binding-specs\/fun_arg\/macro\/enum.h@
-}
fooB = unsafePerformIO hs_bindgen_9383ae52414c2c19
