ยค hIOerr, hIOerrF
Haskell Dialogue IO
Types
hIOerr :: FudgetIO f =>
Request -> (IOError -> f hi ho) -> (Response -> f hi ho) -> f hi ho
hIOerrF :: Request -> (IOError -> F a b) -> (Response -> F a b) -> F a b
Synopsis
hIOerr request failcont f
Description
hIOerr allows a fudget (or kernel) to output an arbitrary Haskell IO request and
wait for the response. hIOerr examines the response to see if an error
occurred, if so, an error continuation is invoked.
Arguments
request :: Request
- A Haskell IO request.
failcont :: IOError -> f hi ho
- The failure continuation
f :: Response -> f hi ho
- A fudget (or kernel) parameterized by a successful IO response.
Example
hIOerrF (ReadFile "/etc/passwd") (\ioerr ->
error ("Cannot open password file: " ++show ioerr)) $ \(Str s) ->
...
See Also
ioF,
haskellIO,
hIO,
hIOSucc.