Comments (9)
Or maybe instead of defer
of the f
, LazyList
's Internal Lazy
should be used somehow?
from purescript-parsing.
How does this relate to replicateA
?
from purescript-parsing.
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.
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.
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.
what you think on takeSome
and takeMany
? do you want to see PR for List/Array?
from purescript-parsing.
Seems like this be implemented using many
and guard
.
from purescript-parsing.
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.
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)
- Fix issues caused by making `<|>` infixr HOT 1
- Change Position to Int HOT 3
- Indents
- purescript-datetime-parsing
- Combinator variations HOT 12
- Talk about alternate backends in documentation
- Fully remove the `Parsing.Pos` module? HOT 1
- liftMaybe, liftEither, liftExceptT HOT 4
- MonadST instance for ParserT? HOT 1
- Drop unicode dependency? HOT 5
- `skipSpaces` always commits to branch even if no spaces are consumed HOT 6
- Chris martin's seven parser types HOT 4
- Parsing a `number` in scientific notation _without_ a decimal exponent fails.
- Change “consume” to “commit” HOT 3
- manyIndex ParseError message
- manyMonoid?
- Consider `Parser0` HOT 1
- Multiple errors HOT 7
- withRecovery HOT 2
- Factor out `Tokens` and `Language` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-parsing.