Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Parsec (parser combinator)

Name: Anonymous 2008-01-23 19:31

I think this is quite cool. (Parsing an IRC 'NICK foo' message)

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.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List