purescript-node / purescript-node-readline Goto Github PK
View Code? Open in Web Editor NEWA low-level PureScript interface to the Node readline API
License: MIT License
A low-level PureScript interface to the Node readline API
License: MIT License
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?
Hello! Firstly, thank you for this package - it's wonderful. Secondly, I've hit a wall, and I think it's because of asynchronous impurities. I wanted to write this little function, withInterface
, to tidy up some of my logic:
withInterface :: forall a . (Interface -> Program a) -> Program a
withInterface f = do
interface <- createConsoleInterface noCompletion
result <- f interface
close interface
pure result
The problem is that writing something like withInterface $ \interface -> prompt interface
will show a prompt and immediately close it. Presumably, this is because close interface
runs before I have time to type anything into the prompt. I'm pretty new to PureScript, but is this something that could be solved with the help of Aff
?
Sorry, I think/hope I answered my own question, but I'm hoping I can work to build something to allow this :) Thanks!
I'm going to work on the PR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.