Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-04 Thread Jan Stolarek
> Of course that is fine. But keep in mind that all parser combinator based > libraries are based on a top-down parsing strategy which in most places, > BUT NOT ALL, fits Haskell's syntax. Try to use the chaining combinators > where-ever possible. In case of doubt you can always spy on how things

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-03 Thread Jan Stolarek
Dnia niedziela, 3 lutego 2013, Doaitse Swierstra napisał: > Use the uu-parsinglib library, which provides error messages, repairs your > errors and using its idioms definition you can even write: > > inParens c = iI '(' c ')' Ii > > I think you cannot get it shorter and with more functionality. > >

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-02 Thread Doaitse Swierstra
On Jan 31, 2013, at 10:47 , Jan Stolarek wrote: > Thanks for replies guys. I indeed didn't notice that there are monads and > applicatives used in > this parser. My thought that monadic parsers are more verbose came from > Hutton's paper where the > code is definitely less readable than in e

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread wren ng thornton
On 1/30/13 7:21 AM, Jan Stolarek wrote: I will be writing a parser in Haskell and I wonder how to approach the problem. My first thought was to use monadic parser, e.g. like the one described by Hutton and Meijer in "Monadic Parsing in Haskell" functional pearl. But then I stumbled upon this:

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Jan Stolarek
Dnia czwartek, 31 stycznia 2013, Ertugrul Söylemez napisał: > Remember that 'Either e' is also a monad. =) I remember - this makes the change from Maybe to Either very easy :) Still I found that adding error message to every combinator and function ads a lot of boilerplate. Also, I experince pr

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Sean Leather
On Wed, Jan 30, 2013 at 1:21 PM, Jan Stolarek wrote: > I will be writing a parser in Haskell and I wonder how to approach the > problem. Utrecht University has a course that covers this, among other things. You might find the slides and lecture notes useful: http://www.cs.uu.nl/wiki/TC/CourseMa

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Ertugrul Söylemez
Jan Stolarek wrote: > Thanks for replies guys. I indeed didn't notice that there are monads > and applicatives used in this parser. My thought that monadic parsers > are more verbose came from Hutton's paper where the code is definitely > less readable than in example I provided. > > There is one

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Jan Stolarek
Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the code is definitely less readable than in example I provided. There is one more thing that bothers me.

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-30 Thread Stephen Tetley
On 30 January 2013 12:38, Ertugrul Söylemez wrote: > > A monadic parser /is/ a combinator parser. The code you linked just > doesn't go as far as wrapping it up with a newtype and providing a monad > instance. Further, (+>) in the linked example is monadic bind and `result` is `return`. The c

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-30 Thread Ertugrul Söylemez
Jan Stolarek wrote: > I will be writing a parser in Haskell and I wonder how to approach the > problem. My first thought was to use monadic parser, e.g. like the one > described by Hutton and Meijer in "Monadic Parsing in Haskell" > functional pearl. But then I stumbled upon this: > > https://git