[Haskell-cafe] Simple shell scripts

2012-08-27 Thread Eric Tanter
Hi,

Here is a simple shell script (upper.hs):

import Data.Char
main = interact $ map toUpper

which composes fine with other scripts:

bash-3.2$ yes | head -n 3 | runghc upper.hs 
Y
Y
Y

but not always:

bash-3.2$ yes | runghc upper.hs | head -n 3
Y
Y
Y
stdout: hFlush: resource vanished (Broken pipe)

Any idea why this error occurs/how to avoid it?

(running just:
yes | runghc upper.hs
gives the expected infinite stream of Ys)

Thanks!

-- Éric

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Simple shell scripts

2012-08-27 Thread Eric Tanter
Thanks Brandon and Iavor for your (fast!) responses.

Installing a silent handler as suggested by Brandon worked nicely.

-- Éric
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe