Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Handle :: *
- data HandlePosn :: *
- data IOMode
- aReadMode :: RefAtom
- aWriteMode :: RefAtom
- aAppendMode :: RefAtom
- aReadWriteMode :: RefAtom
- data BufferMode
- = NoBuffering
- | LineBuffering
- | BlockBuffering (R (Maybe Int))
- aNoBuffering :: RefAtom
- aLineBuffering :: RefAtom
- aBlockBuffering :: RefAtom
- data SeekMode
- aAbsoluteSeek :: RefAtom
- aRelativeSeek :: RefAtom
- aSeekFromEnd :: RefAtom
- gstdin :: RefSrcPos -> RefExp -> R Handle
- gstdout :: RefSrcPos -> RefExp -> R Handle
- gstderr :: RefSrcPos -> RefExp -> R Handle
- gopenFile :: RefSrcPos -> RefExp -> R (Fun String (Fun IOMode (IO Handle)))
- aopenFile :: RefAtom
- hopenFile :: R String -> R IOMode -> RefExp -> R (IO Handle)
- ghClose :: RefSrcPos -> RefExp -> R (Fun Handle (IO Tuple0))
- ahClose :: RefAtom
- hhClose :: R Handle -> RefExp -> R (IO Tuple0)
- ghFileSize :: RefSrcPos -> RefExp -> R (Fun Handle (IO Integer))
- ahFileSize :: RefAtom
- hhFileSize :: R Handle -> RefExp -> R (IO Integer)
- ghIsEOF :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsEOF :: RefAtom
- hhIsEOF :: R Handle -> RefExp -> R (IO Bool)
- gisEOF :: RefSrcPos -> RefExp -> R (IO Bool)
- ghSetBuffering :: RefSrcPos -> RefExp -> R (Fun Handle (Fun BufferMode (IO Tuple0)))
- ahSetBuffering :: RefAtom
- hhSetBuffering :: R Handle -> R BufferMode -> RefExp -> R (IO Tuple0)
- ghGetBuffering :: RefSrcPos -> RefExp -> R (Fun Handle (IO BufferMode))
- ahGetBuffering :: RefAtom
- hhGetBuffering :: R Handle -> RefExp -> R (IO BufferMode)
- ghFlush :: RefSrcPos -> RefExp -> R (Fun Handle (IO Tuple0))
- ahFlush :: RefAtom
- hhFlush :: R Handle -> RefExp -> R (IO Tuple0)
- ghGetPosn :: RefSrcPos -> RefExp -> R (Fun Handle (IO HandlePosn))
- ahGetPosn :: RefAtom
- hhGetPosn :: R Handle -> RefExp -> R (IO HandlePosn)
- ghSetPosn :: RefSrcPos -> RefExp -> R (Fun HandlePosn (IO Tuple0))
- ahSetPosn :: RefAtom
- hhSetPosn :: R HandlePosn -> RefExp -> R (IO Tuple0)
- ghSeek :: RefSrcPos -> RefExp -> R (Fun Handle (Fun SeekMode (Fun Integer (IO Tuple0))))
- ahSeek :: RefAtom
- hhSeek :: R Handle -> R SeekMode -> R Integer -> RefExp -> R (IO Tuple0)
- ghWaitForInput :: RefSrcPos -> RefExp -> R (Fun Handle (Fun Int (IO Bool)))
- ahWaitForInput :: RefAtom
- hhWaitForInput :: R Handle -> R Int -> RefExp -> R (IO Bool)
- ghReady :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahReady :: RefAtom
- hhReady :: R Handle -> RefExp -> R (IO Bool)
- ghGetChar :: RefSrcPos -> RefExp -> R (Fun Handle (IO Char))
- ahGetChar :: RefAtom
- hhGetChar :: R Handle -> RefExp -> R (IO Char)
- ghGetLine :: RefSrcPos -> RefExp -> R (Fun Handle (IO String))
- ahGetLine :: RefAtom
- hhGetLine :: R Handle -> RefExp -> R (IO String)
- ghLookAhead :: RefSrcPos -> RefExp -> R (Fun Handle (IO Char))
- ahLookAhead :: RefAtom
- hhLookAhead :: R Handle -> RefExp -> R (IO Char)
- ghGetContents :: RefSrcPos -> RefExp -> R (Fun Handle (IO String))
- ahGetContents :: RefAtom
- hhGetContents :: R Handle -> RefExp -> R (IO String)
- ghPutChar :: RefSrcPos -> RefExp -> R (Fun Handle (Fun Char (IO Tuple0)))
- ahPutChar :: RefAtom
- hhPutChar :: R Handle -> R Char -> RefExp -> R (IO Tuple0)
- ghPutStr :: RefSrcPos -> RefExp -> R (Fun Handle (Fun String (IO Tuple0)))
- ahPutStr :: RefAtom
- hhPutStr :: R Handle -> R String -> RefExp -> R (IO Tuple0)
- ghPutStrLn :: RefSrcPos -> RefExp -> R (Fun Handle (Fun String (IO Tuple0)))
- ahPutStrLn :: RefAtom
- hhPutStrLn :: R Handle -> R String -> RefExp -> R (IO Tuple0)
- ghPrint :: Show a => RefSrcPos -> RefExp -> R (Fun Handle (Fun a (IO Tuple0)))
- ahPrint :: RefAtom
- hhPrint :: Show a => R Handle -> R a -> RefExp -> R (IO Tuple0)
- ghIsOpen :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsOpen :: RefAtom
- hhIsOpen :: R Handle -> RefExp -> R (IO Bool)
- ghIsClosed :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsClosed :: RefAtom
- hhIsClosed :: R Handle -> RefExp -> R (IO Bool)
- ghIsReadable :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsReadable :: RefAtom
- hhIsReadable :: R Handle -> RefExp -> R (IO Bool)
- ghIsWritable :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsWritable :: RefAtom
- hhIsWritable :: R Handle -> RefExp -> R (IO Bool)
- ghIsSeekable :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsSeekable :: RefAtom
- hhIsSeekable :: R Handle -> RefExp -> R (IO Bool)
- gisAlreadyExistsError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisAlreadyExistsError :: RefAtom
- hisAlreadyExistsError :: R IOError -> RefExp -> R Bool
- gisDoesNotExistError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisDoesNotExistError :: RefAtom
- hisDoesNotExistError :: R IOError -> RefExp -> R Bool
- gisAlreadyInUseError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisAlreadyInUseError :: RefAtom
- hisAlreadyInUseError :: R IOError -> RefExp -> R Bool
- gisFullError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisFullError :: RefAtom
- hisFullError :: R IOError -> RefExp -> R Bool
- gisEOFError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisEOFError :: RefAtom
- hisEOFError :: R IOError -> RefExp -> R Bool
- gisIllegalOperation :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisIllegalOperation :: RefAtom
- hisIllegalOperation :: R IOError -> RefExp -> R Bool
- gisPermissionError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisPermissionError :: RefAtom
- hisPermissionError :: R IOError -> RefExp -> R Bool
- gisUserError :: RefSrcPos -> RefExp -> R (Fun IOError Bool)
- aisUserError :: RefAtom
- hisUserError :: R IOError -> RefExp -> R Bool
- gioeGetErrorString :: RefSrcPos -> RefExp -> R (Fun IOError String)
- aioeGetErrorString :: RefAtom
- hioeGetErrorString :: R IOError -> RefExp -> R String
- gioeGetHandle :: RefSrcPos -> RefExp -> R (Fun IOError (Maybe Handle))
- aioeGetHandle :: RefAtom
- hioeGetHandle :: R IOError -> RefExp -> R (Maybe Handle)
- gioeGetFileName :: RefSrcPos -> RefExp -> R (Fun IOError (Maybe String))
- aioeGetFileName :: RefAtom
- hioeGetFileName :: R IOError -> RefExp -> R (Maybe String)
- gtry :: RefSrcPos -> RefExp -> R (Fun (IO a) (IO (Either IOError a)))
- atry :: RefAtom
- htry :: R (IO a) -> RefExp -> R (IO (Either IOError a))
- gbracket :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (Fun a (IO c)) (IO c))))
- abracket :: RefAtom
- hbracket :: R (IO a) -> R (Fun a (IO b)) -> R (Fun a (IO c)) -> RefExp -> R (IO c)
- gbracket_ :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (IO c) (IO c))))
- abracket_ :: RefAtom
- hbracket_ :: R (IO a) -> R (Fun a (IO b)) -> R (IO c) -> RefExp -> R (IO c)
- data IO a
- type FilePath = String
- type IOError = IOException
- gioError :: RefSrcPos -> RefExp -> R (Fun IOError (IO a))
- aioError :: RefAtom
- hioError :: R IOError -> RefExp -> R (IO b)
- guserError :: RefSrcPos -> RefExp -> R (Fun String IOError)
- auserError :: RefAtom
- huserError :: R String -> RefExp -> R IOError
- gcatch :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun IOError (IO a)) (IO a)))
- acatch :: RefAtom
- hcatch :: R (IO b) -> R (Fun IOError (IO b)) -> RefExp -> R (IO b)
- ginteract :: RefSrcPos -> RefExp -> R (Fun (Fun String String) (IO Tuple0))
- ainteract :: RefAtom
- hinteract :: R (Fun String String) -> RefExp -> R (IO Tuple0)
- gputChar :: RefSrcPos -> RefExp -> R (Fun Char (IO Tuple0))
- aputChar :: RefAtom
- hputChar :: R Char -> RefExp -> R (IO Tuple0)
- gputStr :: RefSrcPos -> RefExp -> R (Fun String (IO Tuple0))
- aputStr :: RefAtom
- hputStr :: R String -> RefExp -> R (IO Tuple0)
- gputStrLn :: RefSrcPos -> RefExp -> R (Fun String (IO Tuple0))
- aputStrLn :: RefAtom
- hputStrLn :: R String -> RefExp -> R (IO Tuple0)
- gprint :: Show a => RefSrcPos -> RefExp -> R (Fun a (IO Tuple0))
- aprint :: RefAtom
- hprint :: Show a => R a -> RefExp -> R (IO Tuple0)
- ggetChar :: RefSrcPos -> RefExp -> R (IO Char)
- ggetLine :: RefSrcPos -> RefExp -> R (IO String)
- ggetContents :: RefSrcPos -> RefExp -> R (IO String)
- greadFile :: RefSrcPos -> RefExp -> R (Fun String (IO String))
- areadFile :: RefAtom
- hreadFile :: R String -> RefExp -> R (IO String)
- gwriteFile :: RefSrcPos -> RefExp -> R (Fun String (Fun String (IO Tuple0)))
- awriteFile :: RefAtom
- hwriteFile :: R String -> R String -> RefExp -> R (IO Tuple0)
- gappendFile :: RefSrcPos -> RefExp -> R (Fun String (Fun String (IO Tuple0)))
- aappendFile :: RefAtom
- happendFile :: R String -> R String -> RefExp -> R (IO Tuple0)
- greadIO :: Read a => RefSrcPos -> RefExp -> R (Fun String (IO a))
- areadIO :: RefAtom
- hreadIO :: Read a => R String -> RefExp -> R (IO a)
- greadLn :: Read a => RefSrcPos -> RefExp -> R (IO a)
Documentation
Haskell defines operations to read and write characters from and to files,
represented by values of type Handle
. Each value of this type is a
handle: a record used by the Haskell run-time system to manage I/O
with file system objects. A handle has at least the following properties:
- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).
Most handles will also have a current I/O position indicating where the next
input or output operation will occur. A handle is readable if it
manages only input or both input and output; likewise, it is writable if
it manages only output or both input and output. A handle is open when
first allocated.
Once it is closed it can no longer be used for either input or output,
though an implementation cannot re-use its storage while references
remain to it. Handles are in the Show
and Eq
classes. The string
produced by showing a handle is system dependent; it should include
enough information to identify the handle for debugging. A handle is
equal according to ==
only to itself; no attempt
is made to compare the internal state of different handles for equality.
data HandlePosn :: * #
aWriteMode :: RefAtom Source #
data BufferMode Source #
ahFileSize :: RefAtom Source #
ghGetBuffering :: RefSrcPos -> RefExp -> R (Fun Handle (IO BufferMode)) Source #
hhGetBuffering :: R Handle -> RefExp -> R (IO BufferMode) Source #
ahPutStrLn :: RefAtom Source #
ahIsClosed :: RefAtom Source #
gbracket :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (Fun a (IO c)) (IO c)))) Source #
gbracket_ :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (IO c) (IO c)))) Source #
type IOError = IOException #
auserError :: RefAtom Source #
awriteFile :: RefAtom Source #