
On Fri, Jan 13, 2012 at 10:08:04AM -0800, Donn Cave wrote:
Quoth "Serge D. Mechveliani"
, [ ... why in Haskell instead of FFI ... ] Because it is a direct and the simplest approach. Why does one need a foreign language, if all the needed functions are in the standard Haskell library?
The GHC Haskell library makes some compromises with normal I/O functionality for the sake of its runtime thread system. As difficult as named pipes can be in any case, they can be even trickier in GHC Haskell for this reason. I didn't suggest an FFI approach myself, in my previous follow-up, only because if you haven't worked with the FFI it's a significant initial investment, but I believe it's what I would do. (If I were somehow compelled to used named pipes.)
Initially, I did the example by the Foreign Function Interface for C. But then, I thought "But this is unnatural! Use plainly the standard Haskell IO, it has everything". So, your advice is "return to FFI" ? ------ Sergei mechvel@botik.ru