[Haskell-cafe] Embedding Perl RegEx in Haskell

Brandon Allbery allbery.b at gmail.com
Sun Aug 21 11:13:18 CEST 2011


It just occurred to me that about half the list thinks I just reinvented
parser combinators. Not exactly; the thing that distinguishes regexes in
particular, and the one whose implications I can't quite wrap my brain
around, is that the "many" combinator is actually

> many' = reverse . many

But is it really that simple, and is an implementation with decent
performance and space characteristics really that simple?  Or does something
have to be designed from scratch around longest match semantics to get
decent behavior?  (There's an analogy to folds here.  Using this in place of
Parsec would have terrible space leaks....)

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110821/81cbc07d/attachment.htm>


More information about the Haskell-Cafe mailing list