ListLike-4.7.8.2: Generalized support for list-like structures
CopyrightCopyright (C) 2007 John Goerzen
LicenseBSD3
MaintainerDavid Fox <dsf@seereason.com>, Andreas Abel
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ListLike.IO

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

class ListLike full item => ListLikeIO full item | full -> item where Source #

An extension to ListLike for those data types that support I/O. These functions mirror those in System.IO for the most part. They also share the same names; see the comments in Data.ListLike for help importing them.

Note that some types may not be capable of lazy reading or writing. Therefore, the usual semantics of System.IO functions regarding laziness may or may not be available from a particular implementation.

Minimal complete definition:

  • hGetLine
  • hGetContents
  • hGet
  • hGetNonBlocking
  • hPutStr

Minimal complete definition

hGetLine, hGetContents, hGet, hGetNonBlocking, hPutStr

Methods

hGetLine :: Handle -> IO full Source #

Reads a line from the specified handle

hGetContents :: Handle -> IO full Source #

Read entire handle contents. May be done lazily like hGetContents.

hGet :: Handle -> Int -> IO full Source #

Read specified number of bytes. See hGet for particular semantics.

hGetNonBlocking :: Handle -> Int -> IO full Source #

Non-blocking read. See hGetNonBlocking for more.

hPutStr :: Handle -> full -> IO () Source #

Writing entire data.

hPutStrLn :: Handle -> full -> IO () Source #

Write data plus newline character.

getLine :: IO full Source #

Read one line

getContents :: IO full Source #

Read entire content from stdin. See hGetContents.

putStr :: full -> IO () Source #

Write data to stdout.

putStrLn :: full -> IO () Source #

Write data plus newline character to stdout.

interact :: (full -> full) -> IO () Source #

Interact with stdin and stdout by using a function to transform input to output. May be lazy. See interact for more.

readFile :: FilePath -> IO full Source #

Read file. May be lazy.

writeFile :: FilePath -> full -> IO () Source #

Write data to file.

appendFile :: FilePath -> full -> IO () Source #

Append data to file.

Instances

Instances details
ListLikeIO CharString Char Source # 
Instance details

Defined in Data.ListLike.CharString

ListLikeIO CharStringLazy Char Source # 
Instance details

Defined in Data.ListLike.CharString

ListLikeIO Chars Char Source # 
Instance details

Defined in Data.ListLike.Chars

ListLikeIO ByteString Word8 Source # 
Instance details

Defined in Data.ListLike.Instances

ListLikeIO ByteString Word8 Source # 
Instance details

Defined in Data.ListLike.Instances

ListLikeIO Text Char Source # 
Instance details

Defined in Data.ListLike.Text.Text

ListLikeIO Builder Char Source # 
Instance details

Defined in Data.ListLike.Text.Builder

ListLikeIO Text Char Source # 
Instance details

Defined in Data.ListLike.Text.TextLazy

ListLikeIO String Char Source # 
Instance details

Defined in Data.ListLike.Instances

ListLikeIO (Seq Char) Char Source # 
Instance details

Defined in Data.ListLike.Instances

ListLikeIO (UTF8 ByteString) Char Source # 
Instance details

Defined in Data.ListLike.UTF8

ListLikeIO (UTF8 ByteString) Char Source # 
Instance details

Defined in Data.ListLike.UTF8

(Integral i, Ix i) => ListLikeIO (Array i Char) Char Source # 
Instance details

Defined in Data.ListLike.Instances