memory useage of data types in the time package

wren ng thornton wren at community.haskell.org
Sun May 23 06:47:18 EDT 2010


Isaac Dupree wrote:
> On 05/21/10 09:54, Duncan Coutts wrote:
>> This one is especially useful to make smaller since it is used as a
>> timestamp in many applications, so there tend to be a lot of them.
>>
>> newtype DiffTime = MkDiffTime Pico
>>
>> Again, Pico based on Int64 rather than Integer would save space, save an
>> indirection and allow further unboxing.
> 
> But is it acceptable for the maximum DiffTime to be on the order of 18 
> million years?  (Maybe... but it's less obvious to be alright than 
> trillions of years is...)

I don't know how much it'd complicate the API, but this sounds like an 
argument for having two different types: one for a general difference in 
time (trillions of years), and another for a difference in timestamps (a 
few thousand years should suffice, I'd think).

-- 
Live well,
~wren


More information about the Libraries mailing list