Hoogle Search
Within LTS Haskell 22.23 (ghc-9.6.5)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
readFile :: FilePath -> IO StringCabal-syntax Distribution.Compat.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.
readFile :: FilePath -> IO Stringghc-lib-parser GHC.Prelude.Basic 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.
readFile :: MonadSafe m => FilePath -> Producer' String m ()pipes-safe Pipes.Safe.Prelude Read lines from a file, automatically opening and closing the file as necessary
readFile :: FilePath -> IO Bytesbyteslice Data.Bytes Read an entire file strictly into a Bytes.
readFile :: FilePath -> IO Chunksbyteslice Data.Bytes.Chunks Read an entire file strictly into chunks. If reading from a regular file, this makes an effort read the file into a single chunk.
readFile :: FilePath -> (Stream (Of String) IO () -> IO a) -> IO astreaming Streaming.Prelude Read the lines of a file, using a function of the type: 'Stream (Of String) IO () -> IO a' to turn the stream into a value of type 'IO a'.
>>> S.writeFile "lines.txt" $ S.take 2 S.stdinLn hello<Enter> world<Enter> >>> S.readFile "lines.txt" S.print "hello" "world"
readFile :: MonadIO m => FilePath -> m ByteStringclassy-prelude ClassyPrelude Strictly read a file into a ByteString.
readFile :: FilePath -> IO Stringnumeric-prelude NumericPrelude 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.
readFile :: FilePath -> IO Stringnumeric-prelude NumericPrelude.Base 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.
readFile :: FilePath -> IO Textprotolude Protolude The readFile function reads a file and returns the contents of the file as a string. The entire file is read strictly, as with getContents. Beware that this function (similarly to readFile) is locale-dependent. Unexpected system locale may cause your application to read corrupted data or throw runtime exceptions about "invalid argument (invalid byte sequence)" or "invalid argument (invalid character)". This is also slow, because GHC first converts an entire input to UTF-32, which is afterwards converted to UTF-8. If your data is UTF-8, using decodeUtf8 . readFile is a much faster and safer alternative.