Code Monkey home page Code Monkey logo

purescript-node-readline's People

Contributors

alexmouton avatar aspidites avatar dgendill avatar garyb avatar hdgarrood avatar jordanmartinez avatar kika avatar kl0tl avatar klntsky avatar kritzcreek avatar megamaddu avatar paf31 avatar pt2121 avatar sigma-andex avatar thimoteus avatar thomashoneyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

purescript-node-readline's Issues

How to aggregate the lines

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?

Why can't I write `withInterface`?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.