Hello,<div><br></div><div>I believe this is essentially how URLT works, except the &#39;toAbsPath&#39; function is stored in the reader monad instead of being passed around manually. </div><div><br></div><div>And advantage of using the reader monad is that it also ensures that you are dispatching the right type of URL in each part. More on this in a different post later.</div>
<div><br></div><div>- jeremy</div><div><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 3:49 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Here&#39;s a bit of an orthogonal gist to what Chris has posted. It&#39;s very tedious to program in this style, but it could form the basis for other libraries to build on top of it.<div><br></div><div><a href="http://gist.github.com/334475" target="_blank">http://gist.github.com/334475</a></div>

<div><br></div><div>WebPlug is a typeclass that consists of three methods: one to convert to a relative path, one to convert from a relative path, and a dispatch method. The trick is that dispatch is given a function that can convert a WebPlug into an *absolute* path.</div>

<div><br></div><div>Given something like this, I could write a blog WebPlug that creates all internal links via the absolute path function. They would all be guaranteed to be valid by definition, and then the blog could be plugged into another application at any point.</div>

<div><br></div><div>Some standards for loading settings and the like *might* be nice, but aren&#39;t really necesary. Also, I believe that this approach is compatible with either the regular package approach Chris uses above, or a quasi-quoting approach like in Yesod. (Obviously the Yesod code itself would have to change to accomodate this.)</div>

<div><br></div><font color="#888888"><div>Michael</div>
</font><br>_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br></blockquote></div><br></div>