Closed andrewufrank closed 4 years ago
@andrewufrank: The main reason that toHandle
is line-based is for symmetry with fromHandle
(which is also line-based)
What about adding two new utilities named putHandle
and putHandleLn
with a note in the documentation that toHandle
is a synonym for putHandleLn
?
good solution - thank you! I will wait to see it in the next release. (I tried to make a putHandle myself, but it did not work; likely I was distracted by the application issue I wanted to solve. )
Today I was caught by the silent insertion of newline using
toHandle
. I found the previous discussion which suggested to renametoHandle
tohPutStrLn
. I would be happy with atoHandle
and atoHandleLn
.I found by painful experience that functions should do only one thing and not for convenience add other functions. The additional functionality is typically causing enormous cost in those cases where the "convenience" is not wanted; usually searching for the explanation of an error. IMHO
toHandle
should just write to the handle whatever is there without adding anything.Thank you for Pipe! It is an excellent demonstration of how powerful Haskell is.