I'm trying to create some helper functions to eliminate some of the monotony of creating structures, for instance:
applicationInfo ::
CreateVkStruct VkApplicationInfo
'[
"pApplicationName",
"applicationVersion",
"pEngineName",
"engineVersion",
"apiVersion"
] () ->
VkApplicationInfo
applicationInfo rest =
createVk $
set @"sType" VK_STRUCTURE_TYPE_APPLICATION_INFO &*
set @"pNext" VK_NULL &*
rest
However, with this implementation, I have to supply the fields in the order specified in the type signature. Is there some way to resolve this? Would exposing the Union type family help?
Also, it seems like it might be more flexible in this context if there were a way to specify "a CreateVkStruct that has all the fields set except these", and then have the type signature list sType and pNext rather than the ones that the caller must provide.
I'm trying to create some helper functions to eliminate some of the monotony of creating structures, for instance:
However, with this implementation, I have to supply the fields in the order specified in the type signature. Is there some way to resolve this? Would exposing the Union type family help?
Also, it seems like it might be more flexible in this context if there were a way to specify "a CreateVkStruct that has all the fields set except these", and then have the type signature list sType and pNext rather than the ones that the caller must provide.