Sigbjorn wrote:
> I'd actually prefer if stdin&stdout were not constants, but argv was ;)
> Having operators just like getArgs for the standard handles
>
> getStdin :: IO Handle
> getStdout :: IO Handle
> getStderr :: IO Handle
>
> would not prevent an implementation from providing useful redirection
> operations like the following
>
> stdRedirect :: (Handle,Handle,Handle) -> IO a -> IO a
>
> where the second argument is performed using a different standard
> handle triple.
This set off a flury of mail, and I can't tell if the issue has
yet been resolved or not. Apologies if this messsage is now
redundant, but as far as I can see no one addressed Sigbjorn's
message in it's original terms.
Sigbjorn, Yes, your stdRedirect seems like a helpful operator.
But it works just as well with stdin, stdout, and stderr as constants.
For instance,
stdRedirect stdout stdin stderr m
might swap the roles of stdin and stdout within m.
Cheers, -- P