Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Haskell 1.2 Dialogue I/O, extended for Fudgets with Xlib calls, network sockets, etc
Synopsis
- 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
- 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
- data IOError
- type Dialogue = [Response] -> [Request]
- data SigAct
- dialogueToIO :: Dialogue -> IO ()
Documentation
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 |
dialogueToIO :: Dialogue -> IO () Source #
Included just to illustrate that it is possible to convert a Dialogue
IO function to a monadic IO function. The implementation relies on
getChanContents
to construct the lazy list of responses needed by
the dialogue IO function. (See also the functions doRequest
and
fudlogue
.)