darcs patch: forkChild, waitForChild, parIO, timeout

Sebastian Sylvan sylvan at student.chalmers.se
Tue Nov 14 06:55:55 EST 2006


On 11/14/06, David Menendez <zednenem at psualum.com> wrote:
> Peter Simons writes:
>
> >   data TimeoutError = TimeoutError deriving (Show, Typeable)
> >   type Microseconds = Int
> >
> >   timeout :: Microseconds -> IO a -> IO a
>
> This seems like a good place to use DiffTime, from Data.Time.Clock. That
> way, you can specify timeouts using (fractional) seconds and avoid
> confusion as to whether timeout uses microseconds, milliseconds, or
> nanoseconds.
>
> Unforunately, Data.Time.Clock is in the time package. An alternative is
> Micro, from Data.Fixed.

Seems to me that the obvious choice is to use the proper SI unit of
seconds, and pass it in as a Double (or have it be polymorphic and
constrained to RealFrac).

/S
-- 
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862


More information about the Libraries mailing list