As an example of both a unified URL creation framework and persistence framework, I&#39;ve put together a little example of how we could create an &quot;authentication plugin.&quot; For the purposes of our discussion here, we could ignore the persistence piece for now, though I would like to eventually discuss how we could make that better.<div>
<br></div><div>I wrote a small blog post[1] describing the system. The code relevant for our discussion is broken into two files: WebPlug.hs[2] defines the interface and auth-example.hs[3] is the actual example.</div><div>
<br></div><div>In this version of WebPlug.hs, I&#39;ve included WebPlug as a datatype instead of a typeclass. I don&#39;t actually *use* that datatype here, but I think it would be very useful for higher-level utilities like the quasi-quoter to be able to access the three related functions together.</div>
<div><br></div><div>Michael</div><div><br></div><div>[1] <a href="http://www.snoyman.com/blog/entry/persistent-plugs/">http://www.snoyman.com/blog/entry/persistent-plugs/</a></div><div>[2] <a href="http://github.com/snoyberg/persistent/blob/master/WebPlug.hs">http://github.com/snoyberg/persistent/blob/master/WebPlug.hs</a></div>
<div>[3] <a href="http://github.com/snoyberg/persistent/blob/master/auth-example.hs">http://github.com/snoyberg/persistent/blob/master/auth-example.hs</a></div>