Profile cover photo
Profile photo
Zaki Manian
2,687 followers
2,687 followers
About
Zaki's posts

Post has shared content
Tidbits for a Parsec Newbie

Parsec is a phenomenally powerful alternatives to regular expressions for lexical analysis and your parsers will look like less of a brain fuck than a regex...

1. The tutorial on the Parsec website is 5 years out of data and use the parsec 2.0 api. You want to use Parsec 3.0 so refer to this for examples.
https://gist.github.com/geekrelief/89786

2. If you don't need conditionals in your parsers, Applicative style can be very pleasing to look at. https://gist.github.com/VoQn/1604725

3. The <|> combinator only implements choice between parsers that don't consume any input until they succeed. If your parsers look more like the examples, you will need to combine try with <|>.

4. Create a Sum type that defines all the values your parser to generate. 

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Wait while more posts are being loaded