
23 Jul
2009
23 Jul
'09
9:07 a.m.
Ashley Yakeley wrote:
I'm currently working on updating the Data.Fixed module in base. I am adding Typeable and Data instances (automatically derived), and several new HasResolution types (including one for 10^-2, monetary currencies being an obvious Fixed use).
Is an automatic Data instance wise? Morally speaking does a Data.Fixed really "include" a Integer? Compare the question: should the automatic Data instance for Complex a be used, since this exposes the fact that Complex is stored using two components in real/imaginary components? I think that abstract types like Complex and Fixed should be treated as atoms by Data rather than being traversable, but I'm not sure. Jules