Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. readFile :: FilePath -> IO String

    base Prelude

    The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.

  2. readIO :: Read a => String -> IO a

    base Prelude

    The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.

  3. readList :: Read a => ReadS [a]

    base Prelude

    The method readList is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined Read instance of the Char type, where values of type String are expected to use double quotes, rather than square brackets.

  4. readLn :: Read a => IO a

    base Prelude

    The readLn function combines getLine and readIO.

  5. readParen :: Bool -> ReadS a -> ReadS a

    base Prelude

    readParen True p parses what p parses, but surrounded with parentheses. readParen False p parses what p parses, but optionally surrounded with parentheses.

  6. reads :: Read a => ReadS a

    base Prelude

    equivalent to readsPrec with a precedence of 0.

  7. readsPrec :: Read a => Int -> ReadS a

    base Prelude

    attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty. Derived instances of Read and Show satisfy the following:

    That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.

  8. readChan :: Chan a -> IO a

    base Control.Concurrent.Chan

    Read the next value from the Chan. Blocks when the channel is empty. Since the read end of a channel is an MVar, this operation inherits fairness guarantees of MVars (e.g. threads blocked in this operation are woken up in FIFO order). Throws BlockedIndefinitelyOnMVar when the channel is empty and no other thread holds a reference to the channel.

  9. readMVar :: MVar a -> IO a

    base Control.Concurrent.MVar

    Atomically read the contents of an MVar. If the MVar is currently empty, readMVar will wait until it is full. readMVar is guaranteed to receive the next putMVar. readMVar is multiple-wakeup, so when multiple readers are blocked on an MVar, all of them are woken up at the same time. The runtime guarantees that all woken threads complete their readMVar operation. Compatibility note: Prior to base 4.7, readMVar was a combination of takeMVar and putMVar. This mean that in the presence of other threads attempting to putMVar, readMVar could block. Furthermore, readMVar would not receive the next putMVar if there was already a pending thread blocked on takeMVar. The old behavior can be recovered by implementing 'readMVar as follows:

    readMVar :: MVar a -> IO a
    readMVar m =
    mask_ $ do
    a <- takeMVar m
    putMVar m a
    return a
    

  10. readLitChar :: ReadS Char

    base Data.Char

    Read a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example:

    readLitChar "\\nHello"  =  [('\n', "Hello")]
    

Page 20 of many | Previous | Next