Coder Social home page Coder Social logo

Comments (9)

safareli avatar safareli commented on September 27, 2024

Or maybe instead of defer of the f, LazyList's Internal Lazy should be used somehow?

from purescript-parsing.

paf31 avatar paf31 commented on September 27, 2024

How does this relate to replicateA?

from purescript-parsing.

safareli avatar safareli commented on September 27, 2024

It's somewhat related but it has no some/many semantics. like takeMeny will try parser n times, but if at some it fails, it will return staff it has already collected.

from purescript-parsing.

safareli avatar safareli commented on September 27, 2024

takeMany n will try parser up to n times and result could possibly contain zero elements
takeSome n will try parser up to n times and result must contain at least one success

from purescript-parsing.

safareli avatar safareli commented on September 27, 2024

I think we should define takeSome and takeMany on List and Array as there is no other thing with semantics described above. the only way to fulfill the need I had, was to implement this functions as no other existing functions can help. I think it could be useful to others too

from purescript-parsing.

safareli avatar safareli commented on September 27, 2024

what you think on takeSome and takeMany ? do you want to see PR for List/Array?

from purescript-parsing.

paf31 avatar paf31 commented on September 27, 2024

Seems like this be implemented using many and guard.

from purescript-parsing.

safareli avatar safareli commented on September 27, 2024

Hm, If you use guard them you might need Monad instance, even if monad instance I can't think of such implementation :/

from purescript-parsing.

jamesdbrock avatar jamesdbrock commented on September 27, 2024

replicateA repeats a pattern exactly n times. Regular expressions have first-class quantifier syntax for repeating a pattern at least n or a most m times. It's a common pattern. Would be nice to have API support for this, or at least documentation which explains how to accomplish it.

from purescript-parsing.

Related Issues (20)

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.