Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread wren ng thornton
Bulat Ziganshin wrote: Hello wren, Thursday, November 6, 2008, 12:00:22 PM, you wrote: the trie automaton I mentioned in my previous post: just add a (?{ $value = ... }) action to the end of each component regex and read out the value of $value after you match. $value? in haskell? :) Shh,

Re[2]: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread Bulat Ziganshin
Hello wren, Thursday, November 6, 2008, 12:00:22 PM, you wrote: > the trie automaton I mentioned in my previous post: just add a (?{ > $value = ... }) action to the end of each component regex and read out > the value of $value after you match. $value? in haskell? :) -- Best regards, Bulat

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread wren ng thornton
ChrisK wrote: If you need to be left-biased then you need a perl-style engine, and you can use the regex-pcre or pcre-light haskell package and the PCRE library. These are obtainable from Hackage. I doubt PCRE uses a simple DFA... I don't know if regex-pcre or pcre-light supports the (?{...

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Richard O'Keefe
On 6 Nov 2008, at 1:25 am, Johannes Waldmann wrote: using strings (inside a program) to represent structured data is wrong (*). +1 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Achim Schneider
"roger peppe" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 5, 2008 at 1:56 PM, Martijn van Steenbergen > <[EMAIL PROTECTED]> wrote: > > I think I'll try roger's (private) > > eek, bitten by "reply to sender only" again! > > i had intended to send to the list too. > I recommend using a newsreader and

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Henning Thielemann
Johannes Waldmann schrieb: > using strings (inside a program) to represent structured data > is wrong (*). > > of course you need strings for interfacing the "outside" world, > but the microsecond they get on the inside, > they should be tokenized and parsed away > into something useful (= an ab

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Johannes Waldmann
using strings (inside a program) to represent structured data is wrong (*). of course you need strings for interfacing the "outside" world, but the microsecond they get on the inside, they should be tokenized and parsed away into something useful (= an abstract syntax tree). (*) corollary: u

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Nicolas Pouillard
Excerpts from ajb's message of Wed Nov 05 03:59:03 +0100 2008: > G'day all. Hi, > > Quoting Achim Schneider <[EMAIL PROTECTED]>: > > > Considering that he's talking about a mud, I figure the grammar is a > > quite straightforward > > > > command = l[eft] | r[ight] | ... | t[ake] | c[ast] > >

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread ajb
G'day all. Quoting Achim Schneider <[EMAIL PROTECTED]>: Considering that he's talking about a mud, I figure the grammar is a quite straightforward command = l[eft] | r[ight] | ... | t[ake] | c[ast] That is, I'd be very surprised if you even need more than two or three characters lookahead,

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread ajb
G'day all. Quoting Achim Schneider <[EMAIL PROTECTED]>: Considering that he's talking about a mud, I figure the grammar is a quite straightforward command = l[eft] | r[ight] | ... | t[ake] | c[ast] That is, I'd be very surprised if you even need more than two or three characters lookahead,

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Derek Elkins
On Tue, 2008-11-04 at 10:02 -0800, Dan Piponi wrote: > On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]> wrote: > > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote: > > For anything remotely connected to parsing, always use parsec. > > > > I'd not be surprised if the beast is to

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread pierre
On Tue, Nov 04, 2008 at 08:34:37PM +0100, Achim Schneider wrote: > > Parsec is a thousand times more efficient for such things than regular > expressions, and you can just lazily parse all the input into a list > of data constructors and happily fold it into your state... I would recommend you to

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread ChrisK
The regex-tdfa package (and regex-posix) implement subexpressions capture. So if you want to match alpha beta and gamma in parallel you could write "(alpha)|(beta)|(gamma)" and check which subexpression has the non-empty match. This becomes slightly complicated if there are parenthesis and capt

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Achim Schneider
"Dan Piponi" <[EMAIL PROTECTED]> wrote: > On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]> > wrote: > > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote: > > For anything remotely connected to parsing, always use parsec. > > > > I'd not be surprised if the beast is touring comp

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Dan Piponi
On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]> wrote: > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote: > For anything remotely connected to parsing, always use parsec. > > I'd not be surprised if the beast is touring complete in itself... Actually, this can count against y

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Jonathan Cast
On Tue, 2008-11-04 at 18:26 +0100, Achim Schneider wrote: > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote: > > > Does anyone have any experience with this? What's the best way to > > achieve this? > > > For anything remotely connected to parsing, always use parsec. > > I'd not be surprised

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Achim Schneider
Martijn van Steenbergen <[EMAIL PROTECTED]> wrote: > Does anyone have any experience with this? What's the best way to > achieve this? > For anything remotely connected to parsing, always use parsec. I'd not be surprised if the beast is touring complete in itself... or can parse something that