
On Nov 29, 2007, at 12:12 , Arthur van Leeuwen wrote:
Going through Rational is the right solution, though. My hackish detour was to use fromIntegral . toInteger . fromEnum
?? fromEnum produces an Int, which is an Integral such as fromIntegral requires; why is toInteger needed?
Yes, that would be good! Note that both the docs for DiffTime and EpochTime state that they contain seconds, and both are somewhat unclear as to whether they contain any higher precision than whole seconds.
(a) Whether EpochTime contains higher precision than seconds is system-dependent. (b) Use of a non-Integral type for EpochTime does not necessarily mean it has higher resolution than seconds. (Blame POSIX for both of these. Haskell's System.POSIX must deal, as must any other POSIX-compliant library.) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH