Safe Haskell | None |
---|---|
Language | Haskell98 |
- data IO a
- gfixIO :: RefSrcPos -> RefExp -> R (Fun (Fun a (IO a)) (IO a))
- afixIO :: RefAtom
- hfixIO :: R (Fun b (IO b)) -> RefExp -> R (IO b)
- type FilePath = String
- data Handle :: *
- gstdin :: RefSrcPos -> RefExp -> R Handle
- gstdout :: RefSrcPos -> RefExp -> R Handle
- gstderr :: RefSrcPos -> RefExp -> R Handle
- gwithFile :: RefSrcPos -> RefExp -> R (Fun String (Fun IOMode (Fun (Fun Handle (IO r)) (IO r))))
- awithFile :: RefAtom
- hwithFile :: R String -> R IOMode -> R (Fun Handle (IO b)) -> RefExp -> R (IO b)
- gopenFile :: RefSrcPos -> RefExp -> R (Fun String (Fun IOMode (IO Handle)))
- aopenFile :: RefAtom
- hopenFile :: R String -> R IOMode -> RefExp -> R (IO Handle)
- data IOMode
- aReadMode :: RefAtom
- aWriteMode :: RefAtom
- aAppendMode :: RefAtom
- aReadWriteMode :: RefAtom
- ghClose :: RefSrcPos -> RefExp -> R (Fun Handle (IO Tuple0))
- ahClose :: RefAtom
- hhClose :: R Handle -> RefExp -> R (IO Tuple0)
- 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)
- ghFileSize :: RefSrcPos -> RefExp -> R (Fun Handle (IO Integer))
- ahFileSize :: RefAtom
- hhFileSize :: R Handle -> RefExp -> R (IO Integer)
- ghSetFileSize :: RefSrcPos -> RefExp -> R (Fun Handle (Fun Integer (IO Tuple0)))
- ahSetFileSize :: RefAtom
- hhSetFileSize :: R Handle -> R Integer -> RefExp -> R (IO Tuple0)
- ghIsEOF :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsEOF :: RefAtom
- hhIsEOF :: R Handle -> RefExp -> R (IO Bool)
- gisEOF :: RefSrcPos -> RefExp -> R (IO Bool)
- data BufferMode
- = NoBuffering
- | LineBuffering
- | BlockBuffering (R (Maybe Int))
- aNoBuffering :: RefAtom
- aLineBuffering :: RefAtom
- aBlockBuffering :: RefAtom
- 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)
- data HandlePosn :: *
- 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)
- data SeekMode
- aAbsoluteSeek :: RefAtom
- aRelativeSeek :: RefAtom
- aSeekFromEnd :: RefAtom
- ghTell :: RefSrcPos -> RefExp -> R (Fun Handle (IO Integer))
- ahTell :: RefAtom
- hhTell :: R Handle -> RefExp -> R (IO Integer)
- 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)
- ghIsTerminalDevice :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahIsTerminalDevice :: RefAtom
- hhIsTerminalDevice :: R Handle -> RefExp -> R (IO Bool)
- ghSetEcho :: RefSrcPos -> RefExp -> R (Fun Handle (Fun Bool (IO Tuple0)))
- ahSetEcho :: RefAtom
- hhSetEcho :: R Handle -> R Bool -> RefExp -> R (IO Tuple0)
- ghGetEcho :: RefSrcPos -> RefExp -> R (Fun Handle (IO Bool))
- ahGetEcho :: RefAtom
- hhGetEcho :: R Handle -> RefExp -> R (IO Bool)
- ghShow :: RefSrcPos -> RefExp -> R (Fun Handle (IO String))
- ahShow :: RefAtom
- hhShow :: R Handle -> RefExp -> R (IO String)
- 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)
- 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)
- 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.
gwithFile :: RefSrcPos -> RefExp -> R (Fun String (Fun IOMode (Fun (Fun Handle (IO r)) (IO r)))) Source #
aWriteMode :: RefAtom Source #
awriteFile :: RefAtom Source #
ahFileSize :: RefAtom Source #
data BufferMode Source #
ghGetBuffering :: RefSrcPos -> RefExp -> R (Fun Handle (IO BufferMode)) Source #
hhGetBuffering :: R Handle -> RefExp -> R (IO BufferMode) Source #
data HandlePosn :: * #
ahIsClosed :: RefAtom Source #
ahPutStrLn :: RefAtom Source #