Hi, I’m using the singletons and singletons-th libraries, and I want (if possible) to split a singleton definition between files. I tried creating a data family, but I’m getting a Declaration cannot be promoted error.
How could I split the singleton definition between two or more files?
data family Field
data family SField :: Field -> Type
singletons
[d|
data instance Field = Field1 | Field2
|]
>>> Other file:
singletons
[d|
data instance Field = Field3
|]
These data instances are conflicting and are not valid even if they are not promoted. I also think singletons-th simply does not support promoting data families. I don’t know if it is even technically possible; what would the generated code look like?