[Haskell] Sequencing of input and output, troubles in kdevelop

Ketil Malde ketil+haskell at ii.uib.no
Fri Aug 27 12:24:10 EDT 2004


"A.J. Bonnema" <abonnema at xs4all.nl> writes:

> Actually, I asked kdevelop to run in an external terminal. Also, if I
> run the command "./prog" (where prog is the name), the program behaves
> the same. So, ghc should not assume anything else than having input
> from standard input....

Hmm...did you try setting the buffering explicitly, as was suggested
here? 

> I am not sure here. Isn't the output dependant on the input, because
> it depends on which filenames I enter? If I enter an erroneous input

Yes, that's true, a nonexisting file name should cause it to terminate
before output is complete, I guess.  It's slightly irrelevant, though,
because the problem isn't the laziness in Haskell, but the laziness in
the operating system in the form of buffering of output.

> So, sequence should be important.

Yes.  And as far as Haskell is concerned, it *has* pushed the string
to stdout - but the OS delays the writing for performance reasons.

> Well, as I said, I'm just starting......

Hope this helps,

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell mailing list