New patches: [changed Timeouts to be possibly fractional amount of seconds (type Double) Tomasz Zielonka **20041014063618] { hunk ./Childs.hs 25 - , Timeout -- = Int + , Timeout -- = Double + , timeoutDelay-- :: Timeout -> IO () hunk ./Childs.hs 114 --- |Timeouts are given in milliseconds (@1\/10^6@ seconds). +-- |Timeouts are given in seconds, which can be fractional. hunk ./Childs.hs 117 -type Timeout = Int +type Timeout = Double + +timeoutDelay :: Timeout -> IO () +timeoutDelay t = threadDelay (round (t * 1000000.0)) hunk ./Childs.hs 123 --- 'Nothing' after @n@ milliseconds, otherwise @'Just' a@ is +-- 'Nothing' after @n@ seconds, otherwise @'Just' a@ is hunk ./Childs.hs 131 - r <- par (threadDelay n >> return []) (fmap return f) + r <- par (timeoutDelay n >> return []) (fmap return f) hunk ./Childs.hs 137 --- |@sleep n@ @=@ @threadDelay (abs(n) * 1000000)@ +-- |@sleep n@ @=@ @timeoutDelay (fromIntegral (min n 0))@ hunk ./Childs.hs 140 -sleep n = threadDelay (abs(n) * 1000000) +sleep n = timeoutDelay (fromIntegral (min n 0)) } [fixed timeoutDelay to handle delays overflowing the number of microseconds in Int Tomasz Zielonka **20041014063805] { hunk ./Childs.hs 120 -timeoutDelay t = threadDelay (round (t * 1000000.0)) +timeoutDelay t | t > 100.0 = threadDelay 100000000 >> timeoutDelay (t - 100.0) + | otherwise = threadDelay (round (t * 1000000.0)) } Context: [initial version simons@cryp.to**20041012201657] Patch bundle hash: c2369d21a3326586b350cc55f693644b72fd08cb