Block-I/O in Haskell

Peter Simons simons at cryp.to
Thu Oct 14 08:32:55 EDT 2004


Tomasz Zielonka writes:

 > Did you consider using floating-point Timeout type, with
 > its values representing seconds, possibly fractional?
 > This could have some negative performance impact, but
 > would be elegant IMHO.

It certainly is more elegant, but I personally would rather
not have these calculations from Double to Int in the
low-level routines. I think it would be better to wrap
'timeout' with a separate function which does this, so that
people can choose whether they'd like to specify the timeout
in microseconds or in a fraction of seconds.

Thinking about it, these conversions would probably be
useful on their own right, independently from any timeout
functions.


 > 2^31 microseconds is not such long

You are right, that's less than 36 minutes. Quite
surprising. I've added an appropriate warning to the
documentation -- thanks for the hint!

Peter



More information about the Libraries mailing list