
27 Aug
2012
27 Aug
'12
1:55 p.m.
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