
On Mon, Mar 9, 2015 at 1:30 PM, martin
How would I use this? If I have a listProf and I want to perform pCount, must I then choose the pCount from listProf? Something like
pCount listProf aProfile
But then my code knows that I am using a list representation, which is the thing I wanted to avoid.
I tried to pair the ops with the representation, but this also got me into trouble, because when I e.g. do a pAdd then it gets strange when the two operands do not use the same Ops.
You could possibly hide the details by using GADTs, adding a new data constructor for each underlying type (which could also be abstracted as in the suggestion from Tom), but you still have to deal with an unavoidable issue -- you'll have to encode how to add collections of disparate types at some point. E.g., how do you add a `Prof Int` that's backed by a `Set a` to a `Prof Int` backed by a `[Int]` ? (at least I think that's unavoidable -- you may be able to solve it with a type class that moves the combination logic elsewhere.) --Rogan