Represent your generic data as simple sums of products, using roughly sigmas and HLists to achieve that. Still an early prototype, but it should be possible to make this fairly efficient using flat HLists and tags.