Closed greghendershott closed 10 years ago
Yes, I see how your lookAhead*
is strictly more useful than lookAhead
so go ahead and change lookAhead
.
And in fact, Haskell's Parsec looks like it behaves like your lookAhead*
so if you changed lookAhead
we would be consistent.
Thanks. Just made a PR for that: https://github.com/stchang/parsack/pull/17
Thanks, merged. 22e39876f6c89c736962cbd8aa97d96295e1852e
I had a situation where I wanted
lookAhead
to check for something in general, and if found, parse based on specifically what it found. ButlookAhead
doesn't return its result.In my app I made a
lookAhead*
, which does return its result:I wonder if I should change Parsack's
lookAhead
to work like this? I believe it would be 100% backward-compatible, and, not have any performance impact -- do you think that's correct?p.s. I'm still new to using Parsack. If you think I'm doing it wrong, using the lookAhead result, please do let me know. In that case either we should leave
lookAhead
as-is, or, make the change but have the docs say something discouraging.p.p.s. If you like the change, I'm happy to make it. Also happy if you'd prefer to make it.