On Mon, Mar 29, 2010 at 11:28 AM, Chris Eidhof <span dir="ltr"><<a href="mailto:chris@eidhof.nl">chris@eidhof.nl</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
-chris<br>
<div class="im"><br>
On 29 mrt 2010, at 18:18, Jeremy Shaw wrote:<br>
<br>
> On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>> wrote:<br>
> Jeremy,<br>
><br>
> We'd been discussing the PathInfo class previously; I understand now what you're trying to achieve with it, but I think for a lot of use cases using a parser like that will be unnecesary. For those cases, I'd hate to introduce a parsec dependency, especially given the 2/3 split we're dealing with right now.<br>
><br>
> Well, parsec is in the haskell platform, so it's really a question of can be it implemented so that it works with both 2 and 3.<br>
<br>
</div>I'm on the latest 6.12 platform, and I only have parsec-2.1 installed. Which packages use parsec-3?<br>
<div class="im"><br></div></blockquote><div>in web-routes, the PathInfo module now contains a function p2u :: Parser a -> URLParser a so that you can lift a Char parser to be a URL parser:</div><div><br></div><div><div>
testp :: URLParser (Char, String, String)</div><div>testp = </div><div> do segment "foo"</div><div> st <- p2u (char 'h' >> char 'o')</div><div> sg <- anySegment</div><div> sg' <- anySegment</div>
<div> return (st,sg, sg')</div><div><br></div><div>but I have not figured out how to implement p2u so that it works under parsec 2 & 3. Maybe I'll just leave it out for now, but I am doing some exploration first.</div>
</div><div><br></div><div>- jeremy</div></div>