[Haskell-cafe] Missing join and split

Mitar mmitar at gmail.com
Fri Dec 28 19:03:18 EST 2007


On Dec 29, 2007 12:13 AM, Evan Laforge <qdunkan at gmail.com> wrote:
> Maybe you could use view patterns?
> foo (regex "(.*);(.*);(.*)") -> [c1, c2, c3] = ...

Oh. Beautiful. :-)

> Parser combinators basically provide generalized regexes, and they all
> take lists of arbitrary tokens rather than just Chars.  I've written a
> simple combinator library before that dispenses with all the monadic
> goodness in favor of a group combinator and returning [Either [tok]
> [tok]], which sort of gives parsers a simpler regexy flavor (Left is
> "out of group chunk" and Right is "in group chunk").
> foo (match (group any `sepBy` char ';') -> [c1, c2, c3]) = ...

Ah. Is this accessible somewhere?


More information about the Haskell-Cafe mailing list