darcs patch: forkChild, waitForChild, parIO, timeout

David Menendez zednenem at psualum.com
Mon Nov 13 21:29:09 EST 2006


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.
-- 
David Menendez <zednenem at psualum.com> <http://www.eyrie.org/~zednenem/>


More information about the Libraries mailing list