Name: Anonymous 2008-01-23 19:31
I think this is quite cool. (Parsing an IRC 'NICK foo' message)
Not quite sure what I think of it in comparison to regular expressions, yet.
special = oneOf "-[]\\`^{}_" -- Taken from RFC1459, except '_',
-- which I added (generally accepted character (are there others?)).
nick = do { string "NICK"; space;
first <- letter; rest <- many1 $ alphaNum <|> special; eof;
return $ Nick (first:rest) }Not quite sure what I think of it in comparison to regular expressions, yet.