purescript-node/purescript-node-readline

How to aggregate the lines

Closed this issue · 1 comments

From the documentation it is unclear to me how you could do anything else than do a line-by-line transformation of the input, because the only way of handling input is by means of the line handler, which can only handle a single independent line.
E.g. how would you write a program that sums all the input lines with a number and prints the result?

This question is likely best answered by seeing what the general solution would be in JavaScript and then seeing what the idiomatic translation to PureScript would be.

When this question was not asked, we did not have complete bindings for readline. As of v10.0.0, we do. If the problem can be resolved using this module, then it should be easy to translate the JS solution to a PS one. If it cannot, then the problem isn't with this library's bindings.

I'd search and then ask on StackOverflow.

Closing.