<br><br><div class="gmail_quote">On Thu, Apr 1, 2010 at 12:13 PM, Jeremy Shaw <span dir="ltr">&lt;<a href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Apr 1, 2010 at 12:19 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br></div><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Minor update: I think that YAML syntax for these kinds of routes is a little bit verbose; any thoughts on this syntax:<div><br></div><div><div><font face="&#39;courier new&#39;, monospace">/                    Home       GET</font></div>


<div><font face="&#39;courier new&#39;, monospace">/user/#userid        User       GET PUT DELETE</font></div><div><font face="&#39;courier new&#39;, monospace">/static              Static     StaticRoutes staticRoutes</font></div>


<div><font face="&#39;courier new&#39;, monospace">/foo/*slurp          Foo</font></div><div><font face="&#39;courier new&#39;, monospace">/bar/$barparam       Bar</font></div>
<div><br></div>First column is the pattern, second is the constructor name, and after that you have three possibilities:</div><div><br></div><div>Nothing is a handler function for any request method. Above, the fourth and fifth entries.</div>


<div>A list of request methods will allow a handler function for each request method. Above, the first and second entries.</div><div>A datatype and function name, allowing a subsite datatype and subsite function. Above,the third entry. I&#39;ll need to develop this one a bit more.</div>

</blockquote><div><br></div></div><div>How would this pattern be translated to the new scheme ?</div><div class="im"><div><br></div><div> /entries/$entryId/$filename:</div><div>    GET: media</div><div><br></div></div><div>
I am guessing:</div><div><br>
</div><div>/entries/$entryId/$filename    Media    GET</div><div><br></div><div>And the Media constructor would be:</div><div> </div><div>   | Media String String </div><div><br></div><div>?</div><div><br></div><div>- jeremy</div>

<div><br></div><div> /entries/$entryId/$filename:</div><div><br></div></div>
</blockquote></div><br><div>Exactly, with the dispatch function being:</div><div><br></div><div>getMedia :: String -&gt; String -&gt; Application</div><div><br></div><div>(Actually, there&#39;s most likely going to be some type of argument datatype as well, which is where the complication I alluded to with subsites comes from. However, I&#39;ll address this more clearly when there&#39;s some actual code to back it up.)</div>
<div><br></div><div>Michael</div>