ยค Dialogue, Request, et al

Haskell Dialogue IO

Types

type Dialogue = [Response] -> [Request]

data Request = ReadFile String
             | WriteFile String String
             | AppendFile String String
             | ReadBinFile String
             | WriteBinFile String Bin
             | AppendBinFile String Bin
             | DeleteFile String
             | StatusFile String
             | ReadBinaryFile String
             | WriteBinaryFile String String
             | ReadXdgFile XdgDirectory String
             | WriteXdgFile XdgDirectory String String
             | ReadChan String
             | AppendChan String String
             | ReadBinChan String
             | AppendBinChan String Bin
             | StatusChan String
             | Echo Bool
             | GetArgs
             | GetEnv String
             | SetEnv String String
             | ReadChannels [String]
             | ReadBinChannels [String]
             | CreateProcess Dialogue
             | CreateDirectory String String
             | OpenFile String Bool
             | OpenBinFile String Bool
             | CloseFile File
             | ReadVal File
             | ReadBinVal File
             | WriteVal File Char
             | WriteBinVal File Bin
             | Sleep Double
             | ChangeDirectory String
             | GetTime
             | DeleteDirectory String
             | System String
             | ReadDirectory String
             | XCommand (XDisplay, XWId, XCommand)
             | GetAsyncInput
             | GetCpuTime
             | GetProgName
             | GetLocalTime
             | ToCalendarTime ClockTime
             | SigAction Int SigAct
             | Exit Int
             | ReadFileScattered String [Int]
             | Select [Descriptor]
             | SocketRequest SocketRequest
             | XRequest (XDisplay, XWId, XRequest)
             | ReadFileFast String
             | RenameFile String String
             | GetCurrentDirectory
             | GetModificationTime FilePath
             | GetCurrentTime
             | GetZonedTime
instance Show Request

data Response = Success
              | Str String
              | Bn Bin
              | Failure IOError
              | Tag [(String, Char)]
              | BinTag [(String, Bin)]
              | StrList [String]
              | Fil File
              | Dbl Double
              | AsyncInput AsyncInput
              | SocketResponse SocketResponse
              | XResponse XResponse
              | IntResp Int
              | SelectResp [([File], [File], [Double])]
              | SigActResp SigAct
              | ClockTime ClockTime
              | CalendarTime CalendarTime
              | UTCTime UTCTime
              | ZonedTime ZonedTime
instance Read Response
instance Show Response

Description

These are the I/O request and response types used for I/O in Haskell 1.2 and earlier, where the type of the main function was Dialogue.

Monadic I/O was introduced in Haskell 1.3 and the type of the main function changed to IO ().