readIO -package:ghc-prim
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)
hedgehog Hedgehog.Internal.Prelude,
base-compat Prelude.Compat,
base-prelude BasePrelude,
numeric-prelude NumericPrelude NumericPrelude.Base,
Cabal-syntax Distribution.Compat.Prelude,
numhask NumHask.Prelude,
clash-prelude Clash.HaskellPrelude,
ghc-lib-parser GHC.Prelude.Basic,
prelude-compat Prelude2010,
pathtype System.Path.IO,
dimensional Numeric.Units.Dimensional.Prelude,
rebase Rebase.Prelude,
mixed-types-num Numeric.MixedTypes.PreludeHiding,
xmonad-contrib XMonad.Config.Prime,
constrained-categories Control.Category.Constrained.Prelude Control.Category.Hask,
copilot-language Copilot.Language.Prelude,
LambdaHack Game.LambdaHack.Core.Prelude,
cabal-install-solver Distribution.Solver.Compat.Prelude,
faktory Faktory.Prelude,
yesod-paginator Yesod.Paginator.Prelude,
distribution-opensuse OpenSuse.Prelude,
hledger-web Hledger.Web.Import 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.
Lifted version of
readIORef.
>>> ref <- newIORef 42
>>> readIORef ref
42
Read the value of an
IORef
Read a value from an
IORef.
Pre-release
Deprecated: Use readIORef from MutByteArray module.
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 from a IORef for a future compare-and-swap.
Will read from a IORef for a future compare-and-swap.