Download Curry: An Integrated Functional Logic Language
Transcript
hClose :: Handle → IO () Closes a file handle and flushes the buffer in case of output file. hFlush :: Handle → IO () Flushes the buffer associated to handle in case of output file. hIsEOF :: Handle → IO Bool Is handle at end of file? isEOF :: IO Bool Is standard input at end of file? hSeek :: Handle → SeekMode → Int → IO () Set the position of a handle to a seekable stream (e.g., a file). If the second argument is AbsoluteSeek, SeekFromEnd, or RelativeSeek, the position is set relative to the beginning of the file, to the end of the file, or to the current position, respectively. hWaitForInput :: Handle → Int → IO Bool Waits until input is available on the given handle. If no input is available within t milliseconds, it returns False, otherwise it returns True. hWaitForInputs :: [Handle] → Int → IO Int Waits until input is available on some of the given handles. If no input is available within t milliseconds, it returns -1, otherwise it returns the index of the corresponding handle with the available data. hWaitForInputOrMsg :: Handle → [a] → IO (Either Handle [a]) Waits until input is available on a given handles or a message in the message stream. Usually, the message stream comes from an external port. Thus, this operation implements a committed choice over receiving input from an IO handle or an external port. Note that the implementation of this operation works only with Sicstus-Prolog 3.8.5 or higher (due to a bug in previous versions of Sicstus-Prolog). hWaitForInputsOrMsg :: [Handle] → [a] → IO (Either Int [a]) Waits until input is available on some of the given handles or a message in the message stream. Usually, the message stream comes from an external port. Thus, this operation implements a committed choice over receiving input from IO handles or an external port. Note that the implementation of this operation works only with Sicstus-Prolog 3.8.5 or higher (due to a bug in previous versions of Sicstus-Prolog). 73