hs-bindgen-1.0.0.0: test-artefacts/fixtures/edge-cases/uses_utf8/th.txt
-- addDependentFile test-artefacts/headers/golden/edge-cases/uses_utf8.h
{-| __C declaration:__ @enum MyEnum@
__defined at:__ @edge-cases\/uses_utf8.h 4:6@
__exported by:__ @edge-cases\/uses_utf8.h@
-}
newtype MyEnum
= MyEnum {unwrapMyEnum :: CUInt}
deriving stock (Eq, Generic, 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 = getField @"unwrapMyEnum"
declaredValues = \_ -> declaredValuesFromList [(0,
singleton "Say\20320\22909"),
(1, singleton "Say\25308\25308")]
showsUndeclared = showsWrappedUndeclared "MyEnum"
readPrecUndeclared = readPrecWrappedUndeclared "MyEnum"
isDeclared = seqIsDeclared
mkDeclared = seqMkDeclared
instance SequentialCEnum MyEnum
where minDeclaredValue = Say你好
maxDeclaredValue = Say拜拜
instance Show MyEnum
where showsPrec = shows
instance Read MyEnum
where readPrec = readPrec
readList = readListDefault
readListPrec = readListPrecDefault
instance (~) ty CUInt => HasField "unwrapMyEnum" MyEnum ty
where hasField = \x_0 -> (\y_1 -> MyEnum{unwrapMyEnum = y_1},
getField @"unwrapMyEnum" x_0)
instance (~) ty CUInt =>
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:__ @Say你好@
__defined at:__ @edge-cases\/uses_utf8.h 5:9@
__exported by:__ @edge-cases\/uses_utf8.h@
-}
pattern Say你好 :: MyEnum
pattern Say你好 = MyEnum 0
{-| __C declaration:__ @Say拜拜@
__defined at:__ @edge-cases\/uses_utf8.h 6:9@
__exported by:__ @edge-cases\/uses_utf8.h@
-}
pattern Say拜拜 :: MyEnum
pattern Say拜拜 = MyEnum 1