readIO

The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program. This operation may fail with:

Examples

>>> fmap (+ 1) (readIO "1")
2
>>> readIO "not quite ()" :: IO ()
*** Exception: user error (Prelude.readIO: no parse)
The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.
The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.
Read the value of an IORef. Beware that the CPU executing a thread can reorder reads or writes to independent locations. See Data.IORef#memmodel for more details.
Read a value from an IOArray
Atomically read the contents of the IOPort. If the IOPort is currently empty, readIOPort will wait until it is full. After a readIOPort, the IOPort is left empty. There is one important property of readIOPort:
  • Only a single threads can be blocked on an IOPort.
Lifted readIORef.
Generalized version of readIORef.
Lifted version of readIORef.
>>> ref <- newIORef 42

>>> readIORef ref
42
Read the value of an IORef
Lifted version of readIORef.
Read a value from an IORef. Pre-release
Read the current value stored in a reference.
readIORef ioref = readForCAS ioref >>= peekTicket
Read from a IORef, returning a newer thread-local non-committed write if there is one.
Read the global state of a IORef.
Read the local state of a IORef.
Read the value of an IORefU
Read from a IORef.
Read from a IORef for a future compare-and-swap.
Read a value from an IOArray
Will read from a IORef.