Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate pattern synonym for enum values #335

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hs-bindgen/fixtures/distilled_lib_1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ DeclData (Struct {structName = "CAnotherTypedefStructT", structConstr = "MkCAnot
DeclInstance (InstanceStorable (Struct {structName = "CAnotherTypedefStructT", structConstr = "MkCAnotherTypedefStructT", structFields = ("cAnotherTypedefStructT_foo",HsPrimType HsPrimCInt) ::: ("cAnotherTypedefStructT_bar",HsPrimType HsPrimCChar) ::: VNil}) (StorableInstance {storableSizeOf = 8, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CAnotherTypedefStructT", structConstr = "MkCAnotherTypedefStructT", structFields = ("cAnotherTypedefStructT_foo",HsPrimType HsPrimCInt) ::: ("cAnotherTypedefStructT_bar",HsPrimType HsPrimCChar) ::: VNil})) [PeekByteOff 0 0,PeekByteOff 0 4]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CAnotherTypedefStructT", structConstr = "MkCAnotherTypedefStructT", structFields = ("cAnotherTypedefStructT_foo",HsPrimType HsPrimCInt) ::: ("cAnotherTypedefStructT_bar",HsPrimType HsPrimCChar) ::: VNil}) 2 (Seq [PokeByteOff 3 0 0,PokeByteOff 3 4 1])))}))
DeclNewtype (Newtype {newtypeName = "CAnotherTypedefEnumE", newtypeConstr = "MkCAnotherTypedefEnumE", newtypeField = "unCAnotherTypedefEnumE", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CAnotherTypedefEnumE", structConstr = "MkCAnotherTypedefEnumE", structFields = ("unCAnotherTypedefEnumE",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CAnotherTypedefEnumE", structConstr = "MkCAnotherTypedefEnumE", structFields = ("unCAnotherTypedefEnumE",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CAnotherTypedefEnumE", structConstr = "MkCAnotherTypedefEnumE", structFields = ("unCAnotherTypedefEnumE",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCFOO", patSynType = "CAnotherTypedefEnumE", patSynConstr = "MkCAnotherTypedefEnumE", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCBAR", patSynType = "CAnotherTypedefEnumE", patSynConstr = "MkCAnotherTypedefEnumE", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CATypeT", newtypeConstr = "MkCATypeT", newtypeField = "unCATypeT", newtypeType = HsPrimType HsPrimCInt})
DeclNewtypeInstance Storable "CATypeT"
DeclNewtype (Newtype {newtypeName = "CVarT", newtypeConstr = "MkCVarT", newtypeField = "unCVarT", newtypeType = HsPrimType HsPrimCInt})
Expand All @@ -26,6 +28,10 @@ DeclNewtype (Newtype {newtypeName = "CATypedefStructT", newtypeConstr = "MkCATyp
DeclNewtypeInstance Storable "CATypedefStructT"
DeclNewtype (Newtype {newtypeName = "CATypedefEnumE", newtypeConstr = "MkCATypedefEnumE", newtypeField = "unCATypedefEnumE", newtypeType = HsPrimType HsPrimCSChar})
DeclInstance (InstanceStorable (Struct {structName = "CATypedefEnumE", structConstr = "MkCATypedefEnumE", structFields = ("unCATypedefEnumE",HsPrimType HsPrimCSChar) ::: VNil}) (StorableInstance {storableSizeOf = 1, storableAlignment = 1, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CATypedefEnumE", structConstr = "MkCATypedefEnumE", structFields = ("unCATypedefEnumE",HsPrimType HsPrimCSChar) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CATypedefEnumE", structConstr = "MkCATypedefEnumE", structFields = ("unCATypedefEnumE",HsPrimType HsPrimCSChar) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCENUMCASE0", patSynType = "CATypedefEnumE", patSynConstr = "MkCATypedefEnumE", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCENUMCASE1", patSynType = "CATypedefEnumE", patSynConstr = "MkCATypedefEnumE", patSynValue = 1})
DeclPatSyn (PatSyn {patSynName = "MkCENUMCASE2", patSynType = "CATypedefEnumE", patSynConstr = "MkCATypedefEnumE", patSynValue = 2})
DeclPatSyn (PatSyn {patSynName = "MkCENUMCASE3", patSynType = "CATypedefEnumE", patSynConstr = "MkCATypedefEnumE", patSynValue = 3})
DeclNewtype (Newtype {newtypeName = "CInt32T", newtypeConstr = "MkCInt32T", newtypeField = "unCInt32T", newtypeType = HsPrimType HsPrimCInt})
DeclNewtypeInstance Storable "CInt32T"
DeclNewtype (Newtype {newtypeName = "CCallbackT", newtypeConstr = "MkCCallbackT", newtypeField = "unCCallbackT", newtypeType = HsFunPtr (HsFun (HsPtr (HsPrimType HsPrimVoid)) (HsFun (HsTypRef "CUint32T") (HsIO (HsTypRef "CUint32T"))))})
Expand Down
18 changes: 18 additions & 0 deletions hs-bindgen/fixtures/distilled_lib_1.pp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ instance F.Storable CAnotherTypedefEnumE where
MkCAnotherTypedefEnumE unCAnotherTypedefEnumE2 ->
F.pokeByteOff ptr0 0 unCAnotherTypedefEnumE2

pattern MkCFOO :: CAnotherTypedefEnumE
pattern MkCFOO = MkCAnotherTypedefEnumE 0

pattern MkCBAR :: CAnotherTypedefEnumE
pattern MkCBAR = MkCAnotherTypedefEnumE 1

newtype CATypeT = MkCATypeT
{ unCATypeT :: FC.CInt
}
Expand Down Expand Up @@ -199,6 +205,18 @@ instance F.Storable CATypedefEnumE where
case s1 of
MkCATypedefEnumE unCATypedefEnumE2 -> F.pokeByteOff ptr0 0 unCATypedefEnumE2

pattern MkCENUMCASE0 :: CATypedefEnumE
pattern MkCENUMCASE0 = MkCATypedefEnumE 0

pattern MkCENUMCASE1 :: CATypedefEnumE
pattern MkCENUMCASE1 = MkCATypedefEnumE 1

pattern MkCENUMCASE2 :: CATypedefEnumE
pattern MkCENUMCASE2 = MkCATypedefEnumE 2

pattern MkCENUMCASE3 :: CATypedefEnumE
pattern MkCENUMCASE3 = MkCATypedefEnumE 3

newtype CInt32T = MkCInt32T
{ unCInt32T :: FC.CInt
}
Expand Down
12 changes: 12 additions & 0 deletions hs-bindgen/fixtures/distilled_lib_1.th.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ instance Storable CAnotherTypedefEnumE
peek = \ptr_0 -> pure MkCAnotherTypedefEnumE <*> peekByteOff ptr_0 0;
poke = \ptr_1 -> \s_2 -> case s_2 of
{MkCAnotherTypedefEnumE unCAnotherTypedefEnumE_3 -> pokeByteOff ptr_1 0 unCAnotherTypedefEnumE_3}}
pattern MkCFOO :: CAnotherTypedefEnumE
pattern MkCFOO = MkCAnotherTypedefEnumE 0
pattern MkCBAR :: CAnotherTypedefEnumE
pattern MkCBAR = MkCAnotherTypedefEnumE 1
newtype CATypeT = MkCATypeT {unCATypeT :: CInt}
deriving newtype instance Storable CATypeT
newtype CVarT = MkCVarT {unCVarT :: CInt}
Expand Down Expand Up @@ -81,6 +85,14 @@ instance Storable CATypedefEnumE
peek = \ptr_0 -> pure MkCATypedefEnumE <*> peekByteOff ptr_0 0;
poke = \ptr_1 -> \s_2 -> case s_2 of
{MkCATypedefEnumE unCATypedefEnumE_3 -> pokeByteOff ptr_1 0 unCATypedefEnumE_3}}
pattern MkCENUMCASE0 :: CATypedefEnumE
pattern MkCENUMCASE0 = MkCATypedefEnumE 0
pattern MkCENUMCASE1 :: CATypedefEnumE
pattern MkCENUMCASE1 = MkCATypedefEnumE 1
pattern MkCENUMCASE2 :: CATypedefEnumE
pattern MkCENUMCASE2 = MkCATypedefEnumE 2
pattern MkCENUMCASE3 :: CATypedefEnumE
pattern MkCENUMCASE3 = MkCATypedefEnumE 3
newtype CInt32T = MkCInt32T {unCInt32T :: CInt}
deriving newtype instance Storable CInt32T
newtype CCallbackT
Expand Down
18 changes: 18 additions & 0 deletions hs-bindgen/fixtures/enums.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
DeclNewtype (Newtype {newtypeName = "CFirst", newtypeConstr = "MkCFirst", newtypeField = "unCFirst", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CFirst", structConstr = "MkCFirst", structFields = ("unCFirst",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CFirst", structConstr = "MkCFirst", structFields = ("unCFirst",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CFirst", structConstr = "MkCFirst", structFields = ("unCFirst",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCFIRST1", patSynType = "CFirst", patSynConstr = "MkCFirst", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCFIRST2", patSynType = "CFirst", patSynConstr = "MkCFirst", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CSecond", newtypeConstr = "MkCSecond", newtypeField = "unCSecond", newtypeType = HsPrimType HsPrimCInt})
DeclInstance (InstanceStorable (Struct {structName = "CSecond", structConstr = "MkCSecond", structFields = ("unCSecond",HsPrimType HsPrimCInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CSecond", structConstr = "MkCSecond", structFields = ("unCSecond",HsPrimType HsPrimCInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CSecond", structConstr = "MkCSecond", structFields = ("unCSecond",HsPrimType HsPrimCInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCSECONDA", patSynType = "CSecond", patSynConstr = "MkCSecond", patSynValue = -1})
DeclPatSyn (PatSyn {patSynName = "MkCSECONDB", patSynType = "CSecond", patSynConstr = "MkCSecond", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCSECONDC", patSynType = "CSecond", patSynConstr = "MkCSecond", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CSame", newtypeConstr = "MkCSame", newtypeField = "unCSame", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CSame", structConstr = "MkCSame", structFields = ("unCSame",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CSame", structConstr = "MkCSame", structFields = ("unCSame",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CSame", structConstr = "MkCSame", structFields = ("unCSame",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCSAMEA", patSynType = "CSame", patSynConstr = "MkCSame", patSynValue = 1})
DeclPatSyn (PatSyn {patSynName = "MkCSAMEB", patSynType = "CSame", patSynConstr = "MkCSame", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CPackad", newtypeConstr = "MkCPackad", newtypeField = "unCPackad", newtypeType = HsPrimType HsPrimCSChar})
DeclInstance (InstanceStorable (Struct {structName = "CPackad", structConstr = "MkCPackad", structFields = ("unCPackad",HsPrimType HsPrimCSChar) ::: VNil}) (StorableInstance {storableSizeOf = 1, storableAlignment = 1, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CPackad", structConstr = "MkCPackad", structFields = ("unCPackad",HsPrimType HsPrimCSChar) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CPackad", structConstr = "MkCPackad", structFields = ("unCPackad",HsPrimType HsPrimCSChar) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCPACKEDA", patSynType = "CPackad", patSynConstr = "MkCPackad", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCPACKEDB", patSynType = "CPackad", patSynConstr = "MkCPackad", patSynValue = 1})
DeclPatSyn (PatSyn {patSynName = "MkCPACKEDC", patSynType = "CPackad", patSynConstr = "MkCPackad", patSynValue = 2})
DeclNewtype (Newtype {newtypeName = "CEnumA", newtypeConstr = "MkCEnumA", newtypeField = "unCEnumA", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CEnumA", structConstr = "MkCEnumA", structFields = ("unCEnumA",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CEnumA", structConstr = "MkCEnumA", structFields = ("unCEnumA",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CEnumA", structConstr = "MkCEnumA", structFields = ("unCEnumA",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCAFOO", patSynType = "CEnumA", patSynConstr = "MkCEnumA", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCABAR", patSynType = "CEnumA", patSynConstr = "MkCEnumA", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CEnumB", newtypeConstr = "MkCEnumB", newtypeField = "unCEnumB", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CEnumB", structConstr = "MkCEnumB", structFields = ("unCEnumB",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CEnumB", structConstr = "MkCEnumB", structFields = ("unCEnumB",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CEnumB", structConstr = "MkCEnumB", structFields = ("unCEnumB",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCBFOO", patSynType = "CEnumB", patSynConstr = "MkCEnumB", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCBBAR", patSynType = "CEnumB", patSynConstr = "MkCEnumB", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CEnumC", newtypeConstr = "MkCEnumC", newtypeField = "unCEnumC", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CEnumC", structConstr = "MkCEnumC", structFields = ("unCEnumC",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CEnumC", structConstr = "MkCEnumC", structFields = ("unCEnumC",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CEnumC", structConstr = "MkCEnumC", structFields = ("unCEnumC",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCCFOO", patSynType = "CEnumC", patSynConstr = "MkCEnumC", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCCBAR", patSynType = "CEnumC", patSynConstr = "MkCEnumC", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CEnumD", newtypeConstr = "MkCEnumD", newtypeField = "unCEnumD", newtypeType = HsPrimType HsPrimCUInt})
DeclInstance (InstanceStorable (Struct {structName = "CEnumD", structConstr = "MkCEnumD", structFields = ("unCEnumD",HsPrimType HsPrimCUInt) ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda "ptr" (Ap (StructCon (Struct {structName = "CEnumD", structConstr = "MkCEnumD", structFields = ("unCEnumD",HsPrimType HsPrimCUInt) ::: VNil})) [PeekByteOff 0 0]), storablePoke = Lambda "ptr" (Lambda "s" (ElimStruct 0 (Struct {structName = "CEnumD", structConstr = "MkCEnumD", structFields = ("unCEnumD",HsPrimType HsPrimCUInt) ::: VNil}) 1 (Seq [PokeByteOff 2 0 0])))}))
DeclPatSyn (PatSyn {patSynName = "MkCDFOO", patSynType = "CEnumD", patSynConstr = "MkCEnumD", patSynValue = 0})
DeclPatSyn (PatSyn {patSynName = "MkCDBAR", patSynType = "CEnumD", patSynConstr = "MkCEnumD", patSynValue = 1})
DeclNewtype (Newtype {newtypeName = "CEnumDT", newtypeConstr = "MkCEnumDT", newtypeField = "unCEnumDT", newtypeType = HsTypRef "CEnumD"})
DeclNewtypeInstance Storable "CEnumDT"
54 changes: 54 additions & 0 deletions hs-bindgen/fixtures/enums.pp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ instance F.Storable CFirst where
case s1 of
MkCFirst unCFirst2 -> F.pokeByteOff ptr0 0 unCFirst2

pattern MkCFIRST1 :: CFirst
pattern MkCFIRST1 = MkCFirst 0

pattern MkCFIRST2 :: CFirst
pattern MkCFIRST2 = MkCFirst 1

newtype CSecond = MkCSecond
{ unCSecond :: FC.CInt
}
Expand All @@ -48,6 +54,15 @@ instance F.Storable CSecond where
case s1 of
MkCSecond unCSecond2 -> F.pokeByteOff ptr0 0 unCSecond2

pattern MkCSECONDA :: CSecond
pattern MkCSECONDA = MkCSecond -1

pattern MkCSECONDB :: CSecond
pattern MkCSECONDB = MkCSecond 0

pattern MkCSECONDC :: CSecond
pattern MkCSECONDC = MkCSecond 1

newtype CSame = MkCSame
{ unCSame :: FC.CUInt
}
Expand All @@ -69,6 +84,12 @@ instance F.Storable CSame where
case s1 of
MkCSame unCSame2 -> F.pokeByteOff ptr0 0 unCSame2

pattern MkCSAMEA :: CSame
pattern MkCSAMEA = MkCSame 1

pattern MkCSAMEB :: CSame
pattern MkCSAMEB = MkCSame 1

newtype CPackad = MkCPackad
{ unCPackad :: FC.CSChar
}
Expand All @@ -90,6 +111,15 @@ instance F.Storable CPackad where
case s1 of
MkCPackad unCPackad2 -> F.pokeByteOff ptr0 0 unCPackad2

pattern MkCPACKEDA :: CPackad
pattern MkCPACKEDA = MkCPackad 0

pattern MkCPACKEDB :: CPackad
pattern MkCPACKEDB = MkCPackad 1

pattern MkCPACKEDC :: CPackad
pattern MkCPACKEDC = MkCPackad 2

newtype CEnumA = MkCEnumA
{ unCEnumA :: FC.CUInt
}
Expand All @@ -111,6 +141,12 @@ instance F.Storable CEnumA where
case s1 of
MkCEnumA unCEnumA2 -> F.pokeByteOff ptr0 0 unCEnumA2

pattern MkCAFOO :: CEnumA
pattern MkCAFOO = MkCEnumA 0

pattern MkCABAR :: CEnumA
pattern MkCABAR = MkCEnumA 1

newtype CEnumB = MkCEnumB
{ unCEnumB :: FC.CUInt
}
Expand All @@ -132,6 +168,12 @@ instance F.Storable CEnumB where
case s1 of
MkCEnumB unCEnumB2 -> F.pokeByteOff ptr0 0 unCEnumB2

pattern MkCBFOO :: CEnumB
pattern MkCBFOO = MkCEnumB 0

pattern MkCBBAR :: CEnumB
pattern MkCBBAR = MkCEnumB 1

newtype CEnumC = MkCEnumC
{ unCEnumC :: FC.CUInt
}
Expand All @@ -153,6 +195,12 @@ instance F.Storable CEnumC where
case s1 of
MkCEnumC unCEnumC2 -> F.pokeByteOff ptr0 0 unCEnumC2

pattern MkCCFOO :: CEnumC
pattern MkCCFOO = MkCEnumC 0

pattern MkCCBAR :: CEnumC
pattern MkCCBAR = MkCEnumC 1

newtype CEnumD = MkCEnumD
{ unCEnumD :: FC.CUInt
}
Expand All @@ -174,6 +222,12 @@ instance F.Storable CEnumD where
case s1 of
MkCEnumD unCEnumD2 -> F.pokeByteOff ptr0 0 unCEnumD2

pattern MkCDFOO :: CEnumD
pattern MkCDFOO = MkCEnumD 0

pattern MkCDBAR :: CEnumD
pattern MkCDBAR = MkCEnumD 1

newtype CEnumDT = MkCEnumDT
{ unCEnumDT :: CEnumD
}
Expand Down
Loading
Loading