-- addDependentFile examples/golden/types/typedefs/typedefs.h
{-| __C declaration:__ @myint@

    __defined at:__ @types\/typedefs\/typedefs.h 1:13@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype Myint
    = Myint {unwrapMyint :: CInt}
      {- ^ __C declaration:__ @myint@

           __defined at:__ @types\/typedefs\/typedefs.h 1:13@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim,
                      Bitfield,
                      Bits,
                      Bounded,
                      Enum,
                      FiniteBits,
                      Integral,
                      Ix,
                      Num,
                      Real)
instance TyEq ty (CFieldType Myint "unwrapMyint") =>
         HasField "unwrapMyint" (Ptr Myint) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapMyint")
instance HasCField Myint "unwrapMyint"
    where type CFieldType Myint "unwrapMyint" = CInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @intptr@

    __defined at:__ @types\/typedefs\/typedefs.h 2:15@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype Intptr
    = Intptr {unwrapIntptr :: (Ptr CInt)}
      {- ^ __C declaration:__ @intptr@

           __defined at:__ @types\/typedefs\/typedefs.h 2:15@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType)
instance TyEq ty (CFieldType Intptr "unwrapIntptr") =>
         HasField "unwrapIntptr" (Ptr Intptr) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapIntptr")
instance HasCField Intptr "unwrapIntptr"
    where type CFieldType Intptr "unwrapIntptr" = Ptr CInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @int2int@

    __defined at:__ @types\/typedefs\/typedefs.h 5:13@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype Int2int
    = Int2int {unwrapInt2int :: (CInt -> IO CInt)}
      {- ^ __C declaration:__ @int2int@

           __defined at:__ @types\/typedefs\/typedefs.h 5:13@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_a6c7dd49f5b9d470_base ::
    Int32 -> IO Int32
 -> IO (FunPtr (Int32 -> IO Int32))
-- __unique:__ @toInt2int@
hs_bindgen_a6c7dd49f5b9d470 :: Int2int -> IO (FunPtr Int2int)
-- __unique:__ @toInt2int@
hs_bindgen_a6c7dd49f5b9d470 = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_a6c7dd49f5b9d470_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_65378a8a3cf640ad_base ::
    FunPtr (Int32 -> IO Int32)
 -> Int32
 -> IO Int32
-- __unique:__ @fromInt2int@
hs_bindgen_65378a8a3cf640ad :: FunPtr Int2int -> Int2int
-- __unique:__ @fromInt2int@
hs_bindgen_65378a8a3cf640ad = \funPtr_0 -> fromFFIType (hs_bindgen_65378a8a3cf640ad_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr Int2int
    where toFunPtr = hs_bindgen_a6c7dd49f5b9d470
instance FromFunPtr Int2int
    where fromFunPtr = hs_bindgen_65378a8a3cf640ad
instance TyEq ty (CFieldType Int2int "unwrapInt2int") =>
         HasField "unwrapInt2int" (Ptr Int2int) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapInt2int")
instance HasCField Int2int "unwrapInt2int"
    where type CFieldType Int2int "unwrapInt2int" = CInt -> IO CInt
          offset# = \_ -> \_ -> 0
{-| Auxiliary type used by 'FunctionPointer_Function'

__C declaration:__ @FunctionPointer_Function@

__defined at:__ @types\/typedefs\/typedefs.h 8:16@

__exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype FunctionPointer_Function_Aux
    = FunctionPointer_Function_Aux {unwrapFunctionPointer_Function_Aux :: (IO Unit)}
      {- ^ Auxiliary type used by 'FunctionPointer_Function'

      __C declaration:__ @FunctionPointer_Function@

      __defined at:__ @types\/typedefs\/typedefs.h 8:16@

      __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_b171c028cdc0781d_base ::
    IO Unit
 -> IO (FunPtr (IO Unit))
-- __unique:__ @toFunctionPointer_Function_Aux@
hs_bindgen_b171c028cdc0781d :: FunctionPointer_Function_Aux ->
                               IO (FunPtr FunctionPointer_Function_Aux)
-- __unique:__ @toFunctionPointer_Function_Aux@
hs_bindgen_b171c028cdc0781d = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_b171c028cdc0781d_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_4c3da8240a31e036_base ::
    FunPtr (IO Unit)
 -> IO Unit
-- __unique:__ @fromFunctionPointer_Function_Aux@
hs_bindgen_4c3da8240a31e036 :: FunPtr FunctionPointer_Function_Aux ->
                               FunctionPointer_Function_Aux
-- __unique:__ @fromFunctionPointer_Function_Aux@
hs_bindgen_4c3da8240a31e036 = \funPtr_0 -> fromFFIType (hs_bindgen_4c3da8240a31e036_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr FunctionPointer_Function_Aux
    where toFunPtr = hs_bindgen_b171c028cdc0781d
instance FromFunPtr FunctionPointer_Function_Aux
    where fromFunPtr = hs_bindgen_4c3da8240a31e036
instance TyEq ty
              (CFieldType FunctionPointer_Function_Aux
                          "unwrapFunctionPointer_Function_Aux") =>
         HasField "unwrapFunctionPointer_Function_Aux"
                  (Ptr FunctionPointer_Function_Aux)
                  (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapFunctionPointer_Function_Aux")
instance HasCField FunctionPointer_Function_Aux
                   "unwrapFunctionPointer_Function_Aux"
    where type CFieldType FunctionPointer_Function_Aux
                          "unwrapFunctionPointer_Function_Aux" = IO Unit
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @FunctionPointer_Function@

    __defined at:__ @types\/typedefs\/typedefs.h 8:16@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype FunctionPointer_Function
    = FunctionPointer_Function {unwrapFunctionPointer_Function :: (FunPtr FunctionPointer_Function_Aux)}
      {- ^ __C declaration:__ @FunctionPointer_Function@

           __defined at:__ @types\/typedefs\/typedefs.h 8:16@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType)
instance TyEq ty
              (CFieldType FunctionPointer_Function
                          "unwrapFunctionPointer_Function") =>
         HasField "unwrapFunctionPointer_Function"
                  (Ptr FunctionPointer_Function)
                  (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapFunctionPointer_Function")
instance HasCField FunctionPointer_Function
                   "unwrapFunctionPointer_Function"
    where type CFieldType FunctionPointer_Function
                          "unwrapFunctionPointer_Function" = FunPtr FunctionPointer_Function_Aux
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @NonFunctionPointer_Function@

    __defined at:__ @types\/typedefs\/typedefs.h 9:14@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype NonFunctionPointer_Function
    = NonFunctionPointer_Function {unwrapNonFunctionPointer_Function :: (CInt ->
                                                                         IO CInt)}
      {- ^ __C declaration:__ @NonFunctionPointer_Function@

           __defined at:__ @types\/typedefs\/typedefs.h 9:14@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_766ae751d60365e9_base ::
    Int32 -> IO Int32
 -> IO (FunPtr (Int32 -> IO Int32))
-- __unique:__ @toNonFunctionPointer_Function@
hs_bindgen_766ae751d60365e9 :: NonFunctionPointer_Function ->
                               IO (FunPtr NonFunctionPointer_Function)
-- __unique:__ @toNonFunctionPointer_Function@
hs_bindgen_766ae751d60365e9 = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_766ae751d60365e9_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_36c7108d046bcbc3_base ::
    FunPtr (Int32 -> IO Int32)
 -> Int32
 -> IO Int32
-- __unique:__ @fromNonFunctionPointer_Function@
hs_bindgen_36c7108d046bcbc3 :: FunPtr NonFunctionPointer_Function ->
                               NonFunctionPointer_Function
-- __unique:__ @fromNonFunctionPointer_Function@
hs_bindgen_36c7108d046bcbc3 = \funPtr_0 -> fromFFIType (hs_bindgen_36c7108d046bcbc3_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr NonFunctionPointer_Function
    where toFunPtr = hs_bindgen_766ae751d60365e9
instance FromFunPtr NonFunctionPointer_Function
    where fromFunPtr = hs_bindgen_36c7108d046bcbc3
instance TyEq ty
              (CFieldType NonFunctionPointer_Function
                          "unwrapNonFunctionPointer_Function") =>
         HasField "unwrapNonFunctionPointer_Function"
                  (Ptr NonFunctionPointer_Function)
                  (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapNonFunctionPointer_Function")
instance HasCField NonFunctionPointer_Function
                   "unwrapNonFunctionPointer_Function"
    where type CFieldType NonFunctionPointer_Function
                          "unwrapNonFunctionPointer_Function" = CInt -> IO CInt
          offset# = \_ -> \_ -> 0
{-| Auxiliary type used by 'F1'

__C declaration:__ @f1@

__defined at:__ @types\/typedefs\/typedefs.h 11:16@

__exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype F1_Aux
    = F1_Aux {unwrapF1_Aux :: (IO Unit)}
      {- ^ Auxiliary type used by 'F1'

      __C declaration:__ @f1@

      __defined at:__ @types\/typedefs\/typedefs.h 11:16@

      __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_00d16e666202ed6c_base ::
    IO Unit
 -> IO (FunPtr (IO Unit))
-- __unique:__ @toF1_Aux@
hs_bindgen_00d16e666202ed6c :: F1_Aux -> IO (FunPtr F1_Aux)
-- __unique:__ @toF1_Aux@
hs_bindgen_00d16e666202ed6c = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_00d16e666202ed6c_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_ddeb5206e8192425_base ::
    FunPtr (IO Unit)
 -> IO Unit
-- __unique:__ @fromF1_Aux@
hs_bindgen_ddeb5206e8192425 :: FunPtr F1_Aux -> F1_Aux
-- __unique:__ @fromF1_Aux@
hs_bindgen_ddeb5206e8192425 = \funPtr_0 -> fromFFIType (hs_bindgen_ddeb5206e8192425_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr F1_Aux
    where toFunPtr = hs_bindgen_00d16e666202ed6c
instance FromFunPtr F1_Aux
    where fromFunPtr = hs_bindgen_ddeb5206e8192425
instance TyEq ty (CFieldType F1_Aux "unwrapF1_Aux") =>
         HasField "unwrapF1_Aux" (Ptr F1_Aux) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapF1_Aux")
instance HasCField F1_Aux "unwrapF1_Aux"
    where type CFieldType F1_Aux "unwrapF1_Aux" = IO Unit
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @f1@

    __defined at:__ @types\/typedefs\/typedefs.h 11:16@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype F1
    = F1 {unwrapF1 :: (FunPtr F1_Aux)}
      {- ^ __C declaration:__ @f1@

           __defined at:__ @types\/typedefs\/typedefs.h 11:16@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType)
instance TyEq ty (CFieldType F1 "unwrapF1") =>
         HasField "unwrapF1" (Ptr F1) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapF1")
instance HasCField F1 "unwrapF1"
    where type CFieldType F1 "unwrapF1" = FunPtr F1_Aux
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @g1@

    __defined at:__ @types\/typedefs\/typedefs.h 13:14@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype G1
    = G1 {unwrapG1 :: (IO Unit)}
      {- ^ __C declaration:__ @g1@

           __defined at:__ @types\/typedefs\/typedefs.h 13:14@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_fa5806570b682579_base ::
    IO Unit
 -> IO (FunPtr (IO Unit))
-- __unique:__ @toG1@
hs_bindgen_fa5806570b682579 :: G1 -> IO (FunPtr G1)
-- __unique:__ @toG1@
hs_bindgen_fa5806570b682579 = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_fa5806570b682579_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_8405c8e75aa78be5_base ::
    FunPtr (IO Unit)
 -> IO Unit
-- __unique:__ @fromG1@
hs_bindgen_8405c8e75aa78be5 :: FunPtr G1 -> G1
-- __unique:__ @fromG1@
hs_bindgen_8405c8e75aa78be5 = \funPtr_0 -> fromFFIType (hs_bindgen_8405c8e75aa78be5_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr G1
    where toFunPtr = hs_bindgen_fa5806570b682579
instance FromFunPtr G1
    where fromFunPtr = hs_bindgen_8405c8e75aa78be5
instance TyEq ty (CFieldType G1 "unwrapG1") =>
         HasField "unwrapG1" (Ptr G1) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapG1")
instance HasCField G1 "unwrapG1"
    where type CFieldType G1 "unwrapG1" = IO Unit
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @g2@

    __defined at:__ @types\/typedefs\/typedefs.h 14:14@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype G2
    = G2 {unwrapG2 :: (FunPtr G1)}
      {- ^ __C declaration:__ @g2@

           __defined at:__ @types\/typedefs\/typedefs.h 14:14@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType)
instance TyEq ty (CFieldType G2 "unwrapG2") =>
         HasField "unwrapG2" (Ptr G2) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapG2")
instance HasCField G2 "unwrapG2"
    where type CFieldType G2 "unwrapG2" = FunPtr G1
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @h1@

    __defined at:__ @types\/typedefs\/typedefs.h 16:14@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype H1
    = H1 {unwrapH1 :: (IO Unit)}
      {- ^ __C declaration:__ @h1@

           __defined at:__ @types\/typedefs\/typedefs.h 16:14@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
foreign import ccall safe "wrapper" hs_bindgen_ffae0d1234ed018f_base ::
    IO Unit
 -> IO (FunPtr (IO Unit))
-- __unique:__ @toH1@
hs_bindgen_ffae0d1234ed018f :: H1 -> IO (FunPtr H1)
-- __unique:__ @toH1@
hs_bindgen_ffae0d1234ed018f = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_ffae0d1234ed018f_base (toFFIType fun_0))
foreign import ccall safe "dynamic" hs_bindgen_1a33688324e1924f_base ::
    FunPtr (IO Unit)
 -> IO Unit
-- __unique:__ @fromH1@
hs_bindgen_1a33688324e1924f :: FunPtr H1 -> H1
-- __unique:__ @fromH1@
hs_bindgen_1a33688324e1924f = \funPtr_0 -> fromFFIType (hs_bindgen_1a33688324e1924f_base (castFunPtrToFFIType funPtr_0))
instance ToFunPtr H1
    where toFunPtr = hs_bindgen_ffae0d1234ed018f
instance FromFunPtr H1
    where fromFunPtr = hs_bindgen_1a33688324e1924f
instance TyEq ty (CFieldType H1 "unwrapH1") =>
         HasField "unwrapH1" (Ptr H1) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapH1")
instance HasCField H1 "unwrapH1"
    where type CFieldType H1 "unwrapH1" = IO Unit
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @h2@

    __defined at:__ @types\/typedefs\/typedefs.h 17:12@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype H2
    = H2 {unwrapH2 :: H1}
      {- ^ __C declaration:__ @h2@

           __defined at:__ @types\/typedefs\/typedefs.h 17:12@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving newtype HasFFIType
instance TyEq ty (CFieldType H2 "unwrapH2") =>
         HasField "unwrapH2" (Ptr H2) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapH2")
instance HasCField H2 "unwrapH2"
    where type CFieldType H2 "unwrapH2" = H1
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @h3@

    __defined at:__ @types\/typedefs\/typedefs.h 18:14@

    __exported by:__ @types\/typedefs\/typedefs.h@
-}
newtype H3
    = H3 {unwrapH3 :: (FunPtr H2)}
      {- ^ __C declaration:__ @h3@

           __defined at:__ @types\/typedefs\/typedefs.h 18:14@

           __exported by:__ @types\/typedefs\/typedefs.h@
      -}
    deriving stock (Eq, Ord, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType)
instance TyEq ty (CFieldType H3 "unwrapH3") =>
         HasField "unwrapH3" (Ptr H3) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapH3")
instance HasCField H3 "unwrapH3"
    where type CFieldType H3 "unwrapH3" = FunPtr H2
          offset# = \_ -> \_ -> 0
