Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
readMaybe :: Read a => String -> Maybe aCabal-syntax Distribution.Compat.Prelude No documentation available.
readParen :: Bool -> ReadS a -> ReadS aCabal-syntax Distribution.Compat.Prelude No documentation available.
-
Cabal-syntax Distribution.Compat.Prelude No documentation available.
readsPrec :: Read a => Int -> ReadS aCabal-syntax Distribution.Compat.Prelude No documentation available.
readFields :: ByteString -> Either ParseError [Field Position]Cabal-syntax Distribution.Fields Parse cabal style ByteString into list of Fields, i.e. the cabal AST. readFields assumes that input ByteString is valid UTF8, specifically it doesn't validate that file is valid UTF8. Therefore bytestrings inside returned Field will be invalid as UTF8 if the input were.
>>> readFields "foo: \223" Right [Field (Name (Position 1 1) "foo") [FieldLine (Position 1 6) "\223"]]
readFields won't (necessarily) fail on invalid UTF8 data, but the reported positions may be off. You may get weird errors on non-UTF8 input, for example readFields will fail on latin1 encoded non-breaking space:>>> isLeft (readFields "\xa0 foo: bar") True
That is rejected because parser thinks \xa0 is a section name, and section arguments may not contain colon. If there are just latin1 non-breaking spaces, they become part of the name:>>> readFields "\xa0\&foo: bar" Right [Field (Name (Position 1 1) "\160foo") [FieldLine (Position 1 7) "bar"]]
The UTF8 non-breaking space is accepted as an indentation character (but warned about by readFields').>>> readFields' "\xc2\xa0 foo: bar" Right ([Field (Name (Position 1 3) "foo") [FieldLine (Position 1 8) "bar"]],[LexWarning LexWarningNBSP (Position 1 1)])
readFields' :: ByteString -> Either ParseError ([Field Position], [LexWarning])Cabal-syntax Distribution.Fields Like readFields but also return lexer warnings.
readFields :: ByteString -> Either ParseError [Field Position]Cabal-syntax Distribution.Fields.Parser Parse cabal style ByteString into list of Fields, i.e. the cabal AST. readFields assumes that input ByteString is valid UTF8, specifically it doesn't validate that file is valid UTF8. Therefore bytestrings inside returned Field will be invalid as UTF8 if the input were.
>>> readFields "foo: \223" Right [Field (Name (Position 1 1) "foo") [FieldLine (Position 1 6) "\223"]]
readFields won't (necessarily) fail on invalid UTF8 data, but the reported positions may be off. You may get weird errors on non-UTF8 input, for example readFields will fail on latin1 encoded non-breaking space:>>> isLeft (readFields "\xa0 foo: bar") True
That is rejected because parser thinks \xa0 is a section name, and section arguments may not contain colon. If there are just latin1 non-breaking spaces, they become part of the name:>>> readFields "\xa0\&foo: bar" Right [Field (Name (Position 1 1) "\160foo") [FieldLine (Position 1 7) "bar"]]
The UTF8 non-breaking space is accepted as an indentation character (but warned about by readFields').>>> readFields' "\xc2\xa0 foo: bar" Right ([Field (Name (Position 1 3) "foo") [FieldLine (Position 1 8) "bar"]],[LexWarning LexWarningNBSP (Position 1 1)])
readFields' :: ByteString -> Either ParseError ([Field Position], [LexWarning])Cabal-syntax Distribution.Fields.Parser Like readFields but also return lexer warnings.
readUTF8File :: FilePath -> IO StringCabal-syntax Distribution.Utils.Generic Reads a UTF8 encoded text file as a Unicode String Reads lazily using ordinary readFile.
readMaybe :: (PrimMonad m, Indexed sh, Storable a) => Array m sh a -> Index sh -> Maybe (m a)comfort-array Data.Array.Comfort.Storable.Mutable No documentation available.