read
The
read function reads input from a string, which must be
completely consumed by the input process.
read fails with an
error if the parse is unsuccessful, and it is therefore
discouraged from being used in real applications. Use
readMaybe
or
readEither for safe alternatives.
>>> read "123" :: Int
123
>>> read "hello" :: Int
*** Exception: Prelude.read: no parse
Read up to the specified number of bytes starting from a specified
offset, returning the number of bytes actually read. This function
should only block if there is no data available. If there is not
enough data available, then the function should just return the
available data. A return value of zero indicates that the end of the
data stream (e.g. end of file) has been reached.
Parse
Readable values, only forwarding the value if the parse
succeeds
Reads one value from an
InputStream.
Returns either a value wrapped in a
Just, or
Nothing if
the end of the stream is reached.
Make a stream of strings into a stream of parsed values, skipping bad
cases
>>> S.sum_ $ S.read $ S.takeWhile (/= "total") S.stdinLn :: IO Int
1000<Enter>
2000<Enter>
total<Enter>
3000
Convert a data stream in the tar file format into an internal data
structure. Decoding errors are reported by the
Fail constructor
of the
Entries type.
- The conversion is done lazily.
Try to read the given number of bytes from an SSL connection. On EOF
an empty ByteString is returned. If the connection dies without a
graceful SSL shutdown, an exception is raised.
NOTE: The returned bytestring could be shorter than the size
requested, see:
https://www.openssl.org/docs/man3.0/man3/SSL_read.html
Get the current value of the counter.
Get the current statistical summary for the event being tracked.
Get the current value of the gauge.
Get the current value of the label.
Convert an
Array into a stream.
Pre-release
Read a stream from the supplied IPv4 host address and port number.
Pre-release
Generate a byte stream from a socket.
>>> read = Socket.readWith defaultChunkSize
Pre-release
Control.Monad.ST.runST (do arr <- new_ 10; Monad.zipWithM_ (write arr) [9,8..0] ['a'..]; read arr 3)
Read a mutable array at the given index.
O(1) Yield the element at a given type-safe position using
Finite.
O(1) Yield the element at a given type-safe position using
Finite.
O(1) Yield the element at a given type-safe position using
Finite.
O(1) Yield the element at a given type-safe position using
Finite.