I think you are looking like something done in the HTML-Combinator-libraries. I tried something like that some time ago, but didn't finish. But perhaps you can get an idea from that. See the files with this mail. (The code is in unknown condition.)
Markus > ah, yes. i was aware that would work. i forgot to mention > the constraint > that i don't want the user to have to use the MkFoo/MkBar > constructors. if i could use them internally to 'test', that would be > great, but that's what i couldn't get to work :).
SaveExFStruct.hs
Description: Binary data
SaveFStruct.hs
Description: Binary data