record accessor names
"Rene de Visser" <[email protected]> Mon, 25 Jul 2005 16:52:06 +0200
| Newsgroups | gmane.comp.lang.haskell.template |
|---|---|
| Message-ID | <[email protected]> |
Hello,
Am I correct in thinking that with reify that I can not find the names of
the read/write accessors rel1 and rel2 from the following?
data SmallDB = SmallDB { rel1 :: Set.Set String
, rel2 :: Set.Set Integer } deriving Show
I thought about quoting the above and splicing it in, but as you can't quote
and splice back into the same module and due to type dependencies this could
result in a mess of recursive modules.
I also though of generating the above from a union type.
i.e. using
data SmallDB = DBREL1 String | DBREL2 Integer
to generate the above. Then I would know the names of the accessors.
However I think it is not possible to have type dependencies based on data
constuctors?
Actually, is this what GADT's allow one to do?
Does template haskell support GADT's`? i.e. with reify and syntax structure
wise?
Rene.