out package:base

the representation of newlines on output
Stopped because the output contains insufficient free elements
A variant of error that does not produce a stack trace.
An attempt was made to index an array outside its declared bounds.
stdout is a handle managing the programs standard output.
Attach a timeout event to arbitrary IO computations.
An exception thrown to a thread by timeout to interrupt a timed-out computation.
Wrap an IO computation to time out and return Nothing in case no result is available within n microseconds (1/10^6 seconds). In case a result is available before the timeout expires, Just a is returned. A negative timeout interval means "wait indefinitely". When specifying long timeouts, be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 μs, less than 36 minutes. Consider using Control.Concurrent.Timeout.timeout from unbounded-delays package.
>>> timeout 1000000 (threadDelay 1000 *> pure "finished on time")
Just "finished on time"
>>> timeout 10000 (threadDelay 100000 *> pure "finished on time")
Nothing
The design of this combinator was guided by the objective that timeout n f should behave exactly the same as f as long as f doesn't time out. This means that f has the same myThreadId it would have without the timeout wrapper. Any exceptions f might throw cancel the timeout and propagate further up. It also possible for f to receive exceptions thrown to it by another thread. A tricky implementation detail is the question of how to abort an IO computation. This combinator relies on asynchronous exceptions internally (namely throwing the computation the Timeout exception). The technique works very well for computations executing inside of the Haskell runtime system, but it doesn't work at all for non-Haskell code. Foreign function calls, for example, cannot be timed out with this combinator simply because an arbitrary C function cannot receive asynchronous exceptions. When timeout is used to wrap an FFI call that blocks, no timeout event can be delivered until the FFI call returns, which pretty much negates the purpose of the combinator. In practice, however, this limitation is less severe than it may sound. Standard I/O functions like hGetBuf, hPutBuf, Network.Socket.accept, or hWaitForInput appear to be blocking, but they really don't because the runtime system uses scheduling mechanisms like select(2) to perform asynchronous I/O, so it is possible to interrupt standard socket I/O or file I/O using this combinator.
Warning: since the TimeoutCallback is called from the I/O manager, it must not throw an exception or block for a long period of time. In particular, be wary of throwTo and killThread: if the target thread is making a foreign call, these functions will block until the call completes.
A timeout registration cookie.
Register a timeout in the given number of microseconds. The returned TimeoutKey can be used to later unregister or update the timeout. The timeout is automatically unregistered after the given time has passed. Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 μs, less than 36 minutes.
Unregister an active timeout.
Update an active timeout to fire in the given number of microseconds. Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 μs, less than 36 minutes.
Common Timer definitions shared between WinIO and RIO. The API of this module is unstable and not meant to be consumed by the general public. If you absolutely must depend on it, make sure to use a tight upper bound, e.g., base < 4.X rather than base < 5, because the interface can change rapidly without much warning.
An edit to apply to a TimeoutQueue.
A timeout registration cookie.
A priority search queue, with timeouts as priorities.
A handle managing output to the Haskell program's standard output channel.