[web-devel] Re: Using a 'real' parser for URL parsing

Chris Eidhof chris at eidhof.nl
Sat Mar 27 10:17:24 EDT 2010


There's probably a better way, but I guess I would write it in a similar way.

-chris

On 26 mrt 2010, at 23:04, Jeremy Shaw wrote:

> Hello,
> 
> Is there some clean way to implement a function like:
> 
> c2s :: GenParser Char () a -> GenParser String () a
> 
> so that we can use Char parsers inside the URL Parser?
> 
> the trivial implementation would be something like:
> 
> http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=8965#a8965
> 
> but that does not do a very good job of reporting the position of parse errors.
> 
> - jeremy
> 
> On Fri, Mar 26, 2010 at 4:11 PM, Chris Eidhof <chris at eidhof.nl> wrote:
> Hey,
> 
> I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch the URL parser to parsec. This simplifies the code a lot. I've used String's (i.e. the URL path components) as tokens for the parser. What do you guys think?
> 
> I'm sorry I haven't been replying to the type-safe URL handling, I was busy with writing this week. The discussion has become quite large! I'll see if I can catch up somewhere this weekend.
> 
> -chris
> 
> 
> 



More information about the web-devel mailing list