[Haskell-cafe] runInteractiveCommand: program ends before writing or reading all the output

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri May 16 05:48:21 EDT 2008

On Thu, 2008-05-15 at 21:04 -0400, Olivier Boudry wrote:

> I tried to place a "length text `seq`" before the mapM_ writeExport to
> force the process output to be read but the result was even worst
> (only one line printed). Apparently withtout the `evaluate` function
> it causes more troubles than it solves.

Yes, you should prefer evaluate over seq (or return $!) in the IO monad
because you sometimes have to distinguish between the evaluation that
happens when you construct your IO actions, and the evaluation that
happens when you run your IO actions. The evaluate action does the
latter and its ordered with respect to the other IO actions.


More information about the Haskell-Cafe mailing list