Hoogle Search

Within LTS Haskell 24.42 (ghc-9.10.3)

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

  1. readWord :: ByteString -> Maybe (Word, ByteString)

    bytestring Data.ByteString.Char8

    Try to read a Word value from the ByteString, returning Just (val, str) on success, where val is the value read and str is the rest of the input string. If the sequence of digits decodes to a value larger than can be represented by a Word, the returned value will be Nothing. readWord does not ignore leading whitespace, the value must start with a decimal digit immediately at the beginning of the input string. Leading + signs are not accepted.

    Examples

    >>> readWord "1729 sum of cubes"
    Just (1729," sum of cubes")
    
    >>> readWord "+1729 has an explicit sign"
    Nothing
    
    >>> readWord "not a decimal number"
    Nothing
    
    >>> readWord "98765432109876543210 overflows maxBound"
    Nothing
    

  2. readWord16 :: ByteString -> Maybe (Word16, ByteString)

    bytestring Data.ByteString.Char8

    A variant of readWord specialised to Word16.

  3. readWord32 :: ByteString -> Maybe (Word32, ByteString)

    bytestring Data.ByteString.Char8

    A variant of readWord specialised to Word32.

  4. readWord64 :: ByteString -> Maybe (Word64, ByteString)

    bytestring Data.ByteString.Char8

    A variant of readWord specialised to Word64.

  5. readWord8 :: ByteString -> Maybe (Word8, ByteString)

    bytestring Data.ByteString.Char8

    A variant of readWord specialised to Word8.

  6. readFile :: FilePath -> IO ByteString

    bytestring Data.ByteString.Lazy

    Read an entire file lazily into a ByteString. The Handle will be held open until EOF is encountered. Note that this function's implementation relies on hGetContents. The reader is advised to read its documentation.

  7. readFile :: FilePath -> IO ByteString

    bytestring Data.ByteString.Lazy.Char8

    Read an entire file lazily into a ByteString. The Handle will be held open until EOF is encountered. Note that this function's implementation relies on hGetContents. The reader is advised to read its documentation.

  8. readInt :: ByteString -> Maybe (Int, ByteString)

    bytestring Data.ByteString.Lazy.Char8

    Try to read a signed Int value from the ByteString, returning Just (val, str) on success, where val is the value read and str is the rest of the input string. If the sequence of digits decodes to a value larger than can be represented by an Int, the returned value will be Nothing. readInt does not ignore leading whitespace, the value must start immediately at the beginning of the input string.

    Examples

    >>> readInt "-1729 sum of cubes"
    Just (-1729," sum of cubes")
    
    >>> readInt "+1: readInt also accepts a leading '+'"
    Just (1, ": readInt also accepts a leading '+'")
    
    >>> readInt "not a decimal number"
    Nothing
    
    >>> readInt "12345678901234567890 overflows maxBound"
    Nothing
    
    >>> readInt "-12345678901234567890 underflows minBound"
    Nothing
    

  9. readInt16 :: ByteString -> Maybe (Int16, ByteString)

    bytestring Data.ByteString.Lazy.Char8

    A variant of readInt specialised to Int16.

  10. readInt32 :: ByteString -> Maybe (Int32, ByteString)

    bytestring Data.ByteString.Lazy.Char8

    A variant of readInt specialised to Int32.

Page 68 of many | Previous | Next