-- addDependentFile examples/golden/types/unions/unions.h
{-| __C declaration:__ @struct Dim2@

    __defined at:__ @types\/unions\/unions.h 1:8@

    __exported by:__ @types\/unions\/unions.h@
-}
data Dim2
    = Dim2 {dim2_x :: CInt
            {- ^ __C declaration:__ @x@

                 __defined at:__ @types\/unions\/unions.h 2:9@

                 __exported by:__ @types\/unions\/unions.h@
            -},
            dim2_y :: CInt
            {- ^ __C declaration:__ @y@

                 __defined at:__ @types\/unions\/unions.h 3:9@

                 __exported by:__ @types\/unions\/unions.h@
            -}}
      {- ^ __C declaration:__ @struct Dim2@

           __defined at:__ @types\/unions\/unions.h 1:8@

           __exported by:__ @types\/unions\/unions.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Dim2
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Dim2
    where readRaw = \ptr_0 -> (pure Dim2 <*> readRaw (Proxy @"dim2_x") ptr_0) <*> readRaw (Proxy @"dim2_y") ptr_0
instance WriteRaw Dim2
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Dim2 dim2_x_2
                                            dim2_y_3 -> writeRaw (Proxy @"dim2_x") ptr_0 dim2_x_2 >> writeRaw (Proxy @"dim2_y") ptr_0 dim2_y_3
deriving via (EquivStorable Dim2) instance Storable Dim2
instance HasCField Dim2 "dim2_x"
    where type CFieldType Dim2 "dim2_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Dim2 "dim2_x") =>
         HasField "dim2_x" (Ptr Dim2) (Ptr ty)
    where getField = fromPtr (Proxy @"dim2_x")
instance HasCField Dim2 "dim2_y"
    where type CFieldType Dim2 "dim2_y" = CInt
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType Dim2 "dim2_y") =>
         HasField "dim2_y" (Ptr Dim2) (Ptr ty)
    where getField = fromPtr (Proxy @"dim2_y")
{-| __C declaration:__ @struct Dim3@

    __defined at:__ @types\/unions\/unions.h 6:8@

    __exported by:__ @types\/unions\/unions.h@
-}
data Dim3
    = Dim3 {dim3_x :: CInt
            {- ^ __C declaration:__ @x@

                 __defined at:__ @types\/unions\/unions.h 7:9@

                 __exported by:__ @types\/unions\/unions.h@
            -},
            dim3_y :: CInt
            {- ^ __C declaration:__ @y@

                 __defined at:__ @types\/unions\/unions.h 8:9@

                 __exported by:__ @types\/unions\/unions.h@
            -},
            dim3_z :: CInt
            {- ^ __C declaration:__ @z@

                 __defined at:__ @types\/unions\/unions.h 9:9@

                 __exported by:__ @types\/unions\/unions.h@
            -}}
      {- ^ __C declaration:__ @struct Dim3@

           __defined at:__ @types\/unions\/unions.h 6:8@

           __exported by:__ @types\/unions\/unions.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Dim3
    where staticSizeOf = \_ -> 12 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Dim3
    where readRaw = \ptr_0 -> ((pure Dim3 <*> readRaw (Proxy @"dim3_x") ptr_0) <*> readRaw (Proxy @"dim3_y") ptr_0) <*> readRaw (Proxy @"dim3_z") ptr_0
instance WriteRaw Dim3
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Dim3 dim3_x_2
                                            dim3_y_3
                                            dim3_z_4 -> writeRaw (Proxy @"dim3_x") ptr_0 dim3_x_2 >> (writeRaw (Proxy @"dim3_y") ptr_0 dim3_y_3 >> writeRaw (Proxy @"dim3_z") ptr_0 dim3_z_4)
deriving via (EquivStorable Dim3) instance Storable Dim3
instance HasCField Dim3 "dim3_x"
    where type CFieldType Dim3 "dim3_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Dim3 "dim3_x") =>
         HasField "dim3_x" (Ptr Dim3) (Ptr ty)
    where getField = fromPtr (Proxy @"dim3_x")
instance HasCField Dim3 "dim3_y"
    where type CFieldType Dim3 "dim3_y" = CInt
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType Dim3 "dim3_y") =>
         HasField "dim3_y" (Ptr Dim3) (Ptr ty)
    where getField = fromPtr (Proxy @"dim3_y")
instance HasCField Dim3 "dim3_z"
    where type CFieldType Dim3 "dim3_z" = CInt
          offset# = \_ -> \_ -> 8
instance TyEq ty (CFieldType Dim3 "dim3_z") =>
         HasField "dim3_z" (Ptr Dim3) (Ptr ty)
    where getField = fromPtr (Proxy @"dim3_z")
{-| __C declaration:__ @union DimPayload@

    __defined at:__ @types\/unions\/unions.h 12:7@

    __exported by:__ @types\/unions\/unions.h@
-}
newtype DimPayload
    = DimPayload {unwrapDimPayload :: ByteArray}
      {- ^ __C declaration:__ @union DimPayload@

           __defined at:__ @types\/unions\/unions.h 12:7@

           __exported by:__ @types\/unions\/unions.h@
      -}
deriving via (SizedByteArray 8 4) instance StaticSize DimPayload
deriving via (SizedByteArray 8 4) instance ReadRaw DimPayload
deriving via (SizedByteArray 8 4) instance WriteRaw DimPayload
deriving via (EquivStorable DimPayload) instance Storable DimPayload
{-|

  __See:__ 'set_dimPayload_dim2'

__C declaration:__ @dim2@

__defined at:__ @types\/unions\/unions.h 13:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayload_dim2 :: DimPayload -> Dim2
{-|

  __See:__ 'set_dimPayload_dim2'

__C declaration:__ @dim2@

__defined at:__ @types\/unions\/unions.h 13:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayload_dim2 = getUnionPayload
{-|

  __See:__ 'get_dimPayload_dim2'

-}
set_dimPayload_dim2 :: Dim2 -> DimPayload
{-|

  __See:__ 'get_dimPayload_dim2'

-}
set_dimPayload_dim2 = setUnionPayload
{-|

  __See:__ 'set_dimPayload_dim3'

__C declaration:__ @dim3@

__defined at:__ @types\/unions\/unions.h 14:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayload_dim3 :: DimPayload -> Dim2
{-|

  __See:__ 'set_dimPayload_dim3'

__C declaration:__ @dim3@

__defined at:__ @types\/unions\/unions.h 14:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayload_dim3 = getUnionPayload
{-|

  __See:__ 'get_dimPayload_dim3'

-}
set_dimPayload_dim3 :: Dim2 -> DimPayload
{-|

  __See:__ 'get_dimPayload_dim3'

-}
set_dimPayload_dim3 = setUnionPayload
instance HasCField DimPayload "dimPayload_dim2"
    where type CFieldType DimPayload "dimPayload_dim2" = Dim2
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType DimPayload "dimPayload_dim2") =>
         HasField "dimPayload_dim2" (Ptr DimPayload) (Ptr ty)
    where getField = fromPtr (Proxy @"dimPayload_dim2")
instance HasCField DimPayload "dimPayload_dim3"
    where type CFieldType DimPayload "dimPayload_dim3" = Dim2
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType DimPayload "dimPayload_dim3") =>
         HasField "dimPayload_dim3" (Ptr DimPayload) (Ptr ty)
    where getField = fromPtr (Proxy @"dimPayload_dim3")
{-| __C declaration:__ @struct Dim@

    __defined at:__ @types\/unions\/unions.h 17:8@

    __exported by:__ @types\/unions\/unions.h@
-}
data Dim
    = Dim {dim_tag :: CInt
           {- ^ __C declaration:__ @tag@

                __defined at:__ @types\/unions\/unions.h 18:9@

                __exported by:__ @types\/unions\/unions.h@
           -},
           dim_payload :: DimPayload
           {- ^ __C declaration:__ @payload@

                __defined at:__ @types\/unions\/unions.h 19:22@

                __exported by:__ @types\/unions\/unions.h@
           -}}
      {- ^ __C declaration:__ @struct Dim@

           __defined at:__ @types\/unions\/unions.h 17:8@

           __exported by:__ @types\/unions\/unions.h@
      -}
instance StaticSize Dim
    where staticSizeOf = \_ -> 12 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Dim
    where readRaw = \ptr_0 -> (pure Dim <*> readRaw (Proxy @"dim_tag") ptr_0) <*> readRaw (Proxy @"dim_payload") ptr_0
instance WriteRaw Dim
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Dim dim_tag_2
                                           dim_payload_3 -> writeRaw (Proxy @"dim_tag") ptr_0 dim_tag_2 >> writeRaw (Proxy @"dim_payload") ptr_0 dim_payload_3
deriving via (EquivStorable Dim) instance Storable Dim
instance HasCField Dim "dim_tag"
    where type CFieldType Dim "dim_tag" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Dim "dim_tag") =>
         HasField "dim_tag" (Ptr Dim) (Ptr ty)
    where getField = fromPtr (Proxy @"dim_tag")
instance HasCField Dim "dim_payload"
    where type CFieldType Dim "dim_payload" = DimPayload
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType Dim "dim_payload") =>
         HasField "dim_payload" (Ptr Dim) (Ptr ty)
    where getField = fromPtr (Proxy @"dim_payload")
{-| __C declaration:__ @union DimPayloadB@

    __defined at:__ @types\/unions\/unions.h 23:15@

    __exported by:__ @types\/unions\/unions.h@
-}
newtype DimPayloadB
    = DimPayloadB {unwrapDimPayloadB :: ByteArray}
      {- ^ __C declaration:__ @union DimPayloadB@

           __defined at:__ @types\/unions\/unions.h 23:15@

           __exported by:__ @types\/unions\/unions.h@
      -}
deriving via (SizedByteArray 8 4) instance StaticSize DimPayloadB
deriving via (SizedByteArray 8 4) instance ReadRaw DimPayloadB
deriving via (SizedByteArray 8 4) instance WriteRaw DimPayloadB
deriving via (EquivStorable DimPayloadB) instance Storable DimPayloadB
{-|

  __See:__ 'set_dimPayloadB_dim2'

__C declaration:__ @dim2@

__defined at:__ @types\/unions\/unions.h 24:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayloadB_dim2 :: DimPayloadB -> Dim2
{-|

  __See:__ 'set_dimPayloadB_dim2'

__C declaration:__ @dim2@

__defined at:__ @types\/unions\/unions.h 24:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayloadB_dim2 = getUnionPayload
{-|

  __See:__ 'get_dimPayloadB_dim2'

-}
set_dimPayloadB_dim2 :: Dim2 -> DimPayloadB
{-|

  __See:__ 'get_dimPayloadB_dim2'

-}
set_dimPayloadB_dim2 = setUnionPayload
{-|

  __See:__ 'set_dimPayloadB_dim3'

__C declaration:__ @dim3@

__defined at:__ @types\/unions\/unions.h 25:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayloadB_dim3 :: DimPayloadB -> Dim2
{-|

  __See:__ 'set_dimPayloadB_dim3'

__C declaration:__ @dim3@

__defined at:__ @types\/unions\/unions.h 25:17@

__exported by:__ @types\/unions\/unions.h@
-}
get_dimPayloadB_dim3 = getUnionPayload
{-|

  __See:__ 'get_dimPayloadB_dim3'

-}
set_dimPayloadB_dim3 :: Dim2 -> DimPayloadB
{-|

  __See:__ 'get_dimPayloadB_dim3'

-}
set_dimPayloadB_dim3 = setUnionPayload
instance HasCField DimPayloadB "dimPayloadB_dim2"
    where type CFieldType DimPayloadB "dimPayloadB_dim2" = Dim2
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType DimPayloadB "dimPayloadB_dim2") =>
         HasField "dimPayloadB_dim2" (Ptr DimPayloadB) (Ptr ty)
    where getField = fromPtr (Proxy @"dimPayloadB_dim2")
instance HasCField DimPayloadB "dimPayloadB_dim3"
    where type CFieldType DimPayloadB "dimPayloadB_dim3" = Dim2
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType DimPayloadB "dimPayloadB_dim3") =>
         HasField "dimPayloadB_dim3" (Ptr DimPayloadB) (Ptr ty)
    where getField = fromPtr (Proxy @"dimPayloadB_dim3")
{-| __C declaration:__ @struct DimB@

    __defined at:__ @types\/unions\/unions.h 28:8@

    __exported by:__ @types\/unions\/unions.h@
-}
data DimB
    = DimB {dimB_tag :: CInt
            {- ^ __C declaration:__ @tag@

                 __defined at:__ @types\/unions\/unions.h 29:9@

                 __exported by:__ @types\/unions\/unions.h@
            -},
            dimB_payload :: DimPayloadB
            {- ^ __C declaration:__ @payload@

                 __defined at:__ @types\/unions\/unions.h 30:17@

                 __exported by:__ @types\/unions\/unions.h@
            -}}
      {- ^ __C declaration:__ @struct DimB@

           __defined at:__ @types\/unions\/unions.h 28:8@

           __exported by:__ @types\/unions\/unions.h@
      -}
instance StaticSize DimB
    where staticSizeOf = \_ -> 12 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw DimB
    where readRaw = \ptr_0 -> (pure DimB <*> readRaw (Proxy @"dimB_tag") ptr_0) <*> readRaw (Proxy @"dimB_payload") ptr_0
instance WriteRaw DimB
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       DimB dimB_tag_2
                                            dimB_payload_3 -> writeRaw (Proxy @"dimB_tag") ptr_0 dimB_tag_2 >> writeRaw (Proxy @"dimB_payload") ptr_0 dimB_payload_3
deriving via (EquivStorable DimB) instance Storable DimB
instance HasCField DimB "dimB_tag"
    where type CFieldType DimB "dimB_tag" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType DimB "dimB_tag") =>
         HasField "dimB_tag" (Ptr DimB) (Ptr ty)
    where getField = fromPtr (Proxy @"dimB_tag")
instance HasCField DimB "dimB_payload"
    where type CFieldType DimB "dimB_payload" = DimPayloadB
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType DimB "dimB_payload") =>
         HasField "dimB_payload" (Ptr DimB) (Ptr ty)
    where getField = fromPtr (Proxy @"dimB_payload")
{-| __C declaration:__ @struct \@AnonA_xy@

    __defined at:__ @types\/unions\/unions.h 35:5@

    __exported by:__ @types\/unions\/unions.h@
-}
data AnonA_xy
    = AnonA_xy {anonA_xy_x :: CDouble
                {- ^ __C declaration:__ @x@

                     __defined at:__ @types\/unions\/unions.h 35:21@

                     __exported by:__ @types\/unions\/unions.h@
                -},
                anonA_xy_y :: CDouble
                {- ^ __C declaration:__ @y@

                     __defined at:__ @types\/unions\/unions.h 35:31@

                     __exported by:__ @types\/unions\/unions.h@
                -}}
      {- ^ __C declaration:__ @struct \@AnonA_xy@

           __defined at:__ @types\/unions\/unions.h 35:5@

           __exported by:__ @types\/unions\/unions.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize AnonA_xy
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw AnonA_xy
    where readRaw = \ptr_0 -> (pure AnonA_xy <*> readRaw (Proxy @"anonA_xy_x") ptr_0) <*> readRaw (Proxy @"anonA_xy_y") ptr_0
instance WriteRaw AnonA_xy
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       AnonA_xy anonA_xy_x_2
                                                anonA_xy_y_3 -> writeRaw (Proxy @"anonA_xy_x") ptr_0 anonA_xy_x_2 >> writeRaw (Proxy @"anonA_xy_y") ptr_0 anonA_xy_y_3
deriving via (EquivStorable AnonA_xy) instance Storable AnonA_xy
instance HasCField AnonA_xy "anonA_xy_x"
    where type CFieldType AnonA_xy "anonA_xy_x" = CDouble
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType AnonA_xy "anonA_xy_x") =>
         HasField "anonA_xy_x" (Ptr AnonA_xy) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_xy_x")
instance HasCField AnonA_xy "anonA_xy_y"
    where type CFieldType AnonA_xy "anonA_xy_y" = CDouble
          offset# = \_ -> \_ -> 8
instance TyEq ty (CFieldType AnonA_xy "anonA_xy_y") =>
         HasField "anonA_xy_y" (Ptr AnonA_xy) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_xy_y")
{-| __C declaration:__ @struct \@AnonA_polar@

    __defined at:__ @types\/unions\/unions.h 36:5@

    __exported by:__ @types\/unions\/unions.h@
-}
data AnonA_polar
    = AnonA_polar {anonA_polar_r :: CDouble
                   {- ^ __C declaration:__ @r@

                        __defined at:__ @types\/unions\/unions.h 36:21@

                        __exported by:__ @types\/unions\/unions.h@
                   -},
                   anonA_polar_p :: CDouble
                   {- ^ __C declaration:__ @p@

                        __defined at:__ @types\/unions\/unions.h 36:31@

                        __exported by:__ @types\/unions\/unions.h@
                   -}}
      {- ^ __C declaration:__ @struct \@AnonA_polar@

           __defined at:__ @types\/unions\/unions.h 36:5@

           __exported by:__ @types\/unions\/unions.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize AnonA_polar
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw AnonA_polar
    where readRaw = \ptr_0 -> (pure AnonA_polar <*> readRaw (Proxy @"anonA_polar_r") ptr_0) <*> readRaw (Proxy @"anonA_polar_p") ptr_0
instance WriteRaw AnonA_polar
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       AnonA_polar anonA_polar_r_2
                                                   anonA_polar_p_3 -> writeRaw (Proxy @"anonA_polar_r") ptr_0 anonA_polar_r_2 >> writeRaw (Proxy @"anonA_polar_p") ptr_0 anonA_polar_p_3
deriving via (EquivStorable AnonA_polar) instance Storable AnonA_polar
instance HasCField AnonA_polar "anonA_polar_r"
    where type CFieldType AnonA_polar "anonA_polar_r" = CDouble
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType AnonA_polar "anonA_polar_r") =>
         HasField "anonA_polar_r" (Ptr AnonA_polar) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_polar_r")
instance HasCField AnonA_polar "anonA_polar_p"
    where type CFieldType AnonA_polar "anonA_polar_p" = CDouble
          offset# = \_ -> \_ -> 8
instance TyEq ty (CFieldType AnonA_polar "anonA_polar_p") =>
         HasField "anonA_polar_p" (Ptr AnonA_polar) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_polar_p")
{-| __C declaration:__ @union AnonA@

    __defined at:__ @types\/unions\/unions.h 34:7@

    __exported by:__ @types\/unions\/unions.h@
-}
newtype AnonA
    = AnonA {unwrapAnonA :: ByteArray}
      {- ^ __C declaration:__ @union AnonA@

           __defined at:__ @types\/unions\/unions.h 34:7@

           __exported by:__ @types\/unions\/unions.h@
      -}
deriving via (SizedByteArray 16 8) instance StaticSize AnonA
deriving via (SizedByteArray 16 8) instance ReadRaw AnonA
deriving via (SizedByteArray 16 8) instance WriteRaw AnonA
deriving via (EquivStorable AnonA) instance Storable AnonA
{-|

  __See:__ 'set_anonA_xy'

__C declaration:__ @xy@

__defined at:__ @types\/unions\/unions.h 35:36@

__exported by:__ @types\/unions\/unions.h@
-}
get_anonA_xy :: AnonA -> AnonA_xy
{-|

  __See:__ 'set_anonA_xy'

__C declaration:__ @xy@

__defined at:__ @types\/unions\/unions.h 35:36@

__exported by:__ @types\/unions\/unions.h@
-}
get_anonA_xy = getUnionPayload
{-|

  __See:__ 'get_anonA_xy'

-}
set_anonA_xy :: AnonA_xy -> AnonA
{-|

  __See:__ 'get_anonA_xy'

-}
set_anonA_xy = setUnionPayload
{-|

  __See:__ 'set_anonA_polar'

__C declaration:__ @polar@

__defined at:__ @types\/unions\/unions.h 36:36@

__exported by:__ @types\/unions\/unions.h@
-}
get_anonA_polar :: AnonA -> AnonA_polar
{-|

  __See:__ 'set_anonA_polar'

__C declaration:__ @polar@

__defined at:__ @types\/unions\/unions.h 36:36@

__exported by:__ @types\/unions\/unions.h@
-}
get_anonA_polar = getUnionPayload
{-|

  __See:__ 'get_anonA_polar'

-}
set_anonA_polar :: AnonA_polar -> AnonA
{-|

  __See:__ 'get_anonA_polar'

-}
set_anonA_polar = setUnionPayload
instance HasCField AnonA "anonA_xy"
    where type CFieldType AnonA "anonA_xy" = AnonA_xy
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType AnonA "anonA_xy") =>
         HasField "anonA_xy" (Ptr AnonA) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_xy")
instance HasCField AnonA "anonA_polar"
    where type CFieldType AnonA "anonA_polar" = AnonA_polar
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType AnonA "anonA_polar") =>
         HasField "anonA_polar" (Ptr AnonA) (Ptr ty)
    where getField = fromPtr (Proxy @"anonA_polar")
