CTime problem

Bulat Ziganshin bulatz at HotPOP.com
Tue May 17 03:27:55 EDT 2005


Hello Frederik,

Tuesday, May 17, 2005, 7:56:32 AM, you wrote:

FE> It looks like CTime (Foreign.C.Types) used to be an Integral but isn't
FE> anymore, why? Isn't it just an integer?

i also found this problem when switching from 6.2.2 to 6.4, but found
some way to walk around it. what is your actual problem?

i think that ctime is no more an Integral because you can't add
CTime+CTime, nor multiple CTime*CTime and so on - just to catch some
possible bugs. but it can be converted to Integral, see at this:

modificationTime :: Ptr CStat -> IO ClockTime
modificationTime stat = do
    mtime <- st_mtime stat
    let realToInteger = round . realToFrac :: Real a => a -> Integer
    return (TOD (realToInteger (mtime :: CTime)) 0)


-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Libraries mailing list