[Haskell-cafe] Replacing stdin from within Haskell

Richard O'Keefe ok at cs.otago.ac.nz
Fri Jun 10 06:36:58 CEST 2011

On 10/06/2011, at 4:12 PM, Brandon Allbery wrote:

> On Thu, Jun 9, 2011 at 23:59, Richard O'Keefe <ok at cs.otago.ac.nz> wrote:
>> I understood the OP's question to mean "does Haskell allow rebinding
>> of what _it_ calls standard input", which would be YES for Pop, Ada,
>> Prolog, and Lisp, just as it is NO for C.
> But none of those are Haskell, and neither GHC nor Hugs provides such
> an abstraction in the standard libraries.

The point is that they *could* have.   The fact that they do not has
nothing whatever to do with UNIX.  It was a Haskell design decision.
My point was not that Haskell can or should do this, but that answering
"can I do this in Haskell" by pointing to what Unix does was no real
explanation at all, given that other languages also running on Unix
have no trouble rebinding "standard input", and that the OP's question
was, even for someone thoroughly familiar with Unix, a reasonable question.

More information about the Haskell-Cafe mailing list