hs-bindgen-1.0.0.0: test-artefacts/fixtures/binding-specs/enum/open/th.txt
-- addDependentFile test-artefacts/headers/golden/binding-specs/enum/open.h
{-| __C declaration:__ @enum foo@
__defined at:__ @binding-specs\/enum\/open.h 1:6@
__exported by:__ @binding-specs\/enum\/open.h@
-}
newtype Foo
= Foo {unwrapFoo :: CUInt}
deriving stock (Eq, Generic, Ord)
deriving newtype HasFFIType
instance StaticSize Foo
where staticSizeOf = \_ -> 4 :: Int
staticAlignment = \_ -> 4 :: Int
instance ReadRaw Foo
where readRaw = \ptr_0 -> pure Foo <*> readRawByteOff ptr_0 (0 :: Int)
instance WriteRaw Foo
where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
Foo unwrapFoo_2 -> writeRawByteOff ptr_0 (0 :: Int) unwrapFoo_2
deriving via (EquivStorable Foo) instance Storable Foo
deriving via CUInt instance Prim Foo
instance CEnum Foo
where type CEnumZ Foo = CUInt
toCEnum = Foo
fromCEnum = getField @"unwrapFoo"
declaredValues = \_ -> declaredValuesFromList [(0,
singleton "Bar"),
(1, singleton "Baz")]
showsUndeclared = showsWrappedUndeclared "Foo"
readPrecUndeclared = readPrecWrappedUndeclared "Foo"
isDeclared = seqIsDeclared
mkDeclared = seqMkDeclared
instance SequentialCEnum Foo
where minDeclaredValue = Bar
maxDeclaredValue = Baz
instance Show Foo
where showsPrec = shows
instance Read Foo
where readPrec = readPrec
readList = readListDefault
readListPrec = readListPrecDefault
instance (~) ty CUInt => HasField "unwrapFoo" Foo ty
where hasField = \x_0 -> (\y_1 -> Foo{unwrapFoo = y_1},
getField @"unwrapFoo" x_0)
instance (~) ty CUInt => HasField "unwrapFoo" (Ptr Foo) (Ptr ty)
where getField = fromPtr (Proxy @"unwrapFoo")
instance HasCField Foo "unwrapFoo"
where type CFieldType Foo "unwrapFoo" = CUInt
offset# = \_ -> \_ -> 0
{-| __C declaration:__ @bar@
__defined at:__ @binding-specs\/enum\/open.h 2:3@
__exported by:__ @binding-specs\/enum\/open.h@
-}
pattern Bar :: Foo
pattern Bar = Foo 0
{-| __C declaration:__ @baz@
__defined at:__ @binding-specs\/enum\/open.h 3:3@
__exported by:__ @binding-specs\/enum\/open.h@
-}
pattern Baz :: Foo
pattern Baz = Foo 1