Data.Fixed.Fixed constructor

Ashley Yakeley ashley at semantic.org
Thu Jul 23 15:29:40 EDT 2009


On Thu, 2009-07-23 at 14:07 +0100, Jules Bean wrote:
> 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.

Could you give me an example of a Data instance for either Complex or
Fixed that you approve of?

Data instances unavoidably expose concrete structure. That may be the
actual internal structure of the type, or it may be some constructed
concrete structure, but it must be something.

-- 
Ashley Yakeley



More information about the Libraries mailing list