hIOerr :: (FudgetIO c) => Request -> (D_IOError -> c a b) -> (_Response -> c a b) -> c a b hIOerrF :: Request -> (IOError -> F a b) -> (Response -> F a b) -> F a b
hIOerr request failcont f
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.
request :: Request
failcont :: D_IOError -> c a b
f :: _Response -> c a b
hIOerrF (ReadFile "/etc/passwd") (\ioerr ->error ("Cannot open password file: " ++show ioerr)) $ \(Str s) -> ...