[web-devel] Type-safe URL handling

Chris Eidhof chris at eidhof.nl
Tue Mar 23 17:24:44 EDT 2010


Hi Jeremy,

Yes, that's why I didn't provide the instance. It should be a real (lightweight) parser. My implementation is just a sketch, not a real implementation.

-chris

On 23 mrt 2010, at 20:36, Jeremy Shaw wrote:

> What happens if you have,
> 
> data UserRoute = Find Int Int
> 
> you need a instance:
> 
> instance (GToURL f, GToURL g) => GToURL (f :*: g)
> 
> I think?
> 
> But the fromURL / gfromURL functions do not have a way to indicate how much of the input they consumed -- which I think will be a problem?
> 
> I believe the current code works because it assumes that each call to gfromURL will consume all the remaining input. But when your constructor has two arguments, the first one better not consume all the rest of the input..
> 
> - jeremy
> 
> On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof <chris at eidhof.nl> wrote:
> Hey everyone,
> 
> I just wrote down some of my ideas about type-safe URL handling on github, it's at http://gist.github.com/333769
> 
> I think it's similar to what Jeremy is doing with his urlt package [1].
> 
> -chris
> 
> [1]: http://src.seereason.com/~jeremy/SimpleSite1.html
> 
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
> 



More information about the web-devel mailing list