<br><br><div class="gmail_quote">On Thu, Apr 1, 2010 at 12:13 PM, Jeremy Shaw <span dir="ltr"><<a href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.com</a>></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"><<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>></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="'courier new', monospace">/ Home GET</font></div>
<div><font face="'courier new', monospace">/user/#userid User GET PUT DELETE</font></div><div><font face="'courier new', monospace">/static Static StaticRoutes staticRoutes</font></div>
<div><font face="'courier new', monospace">/foo/*slurp Foo</font></div><div><font face="'courier new', 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'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 -> String -> Application</div><div><br></div><div>(Actually, there'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'll address this more clearly when there's some actual code to back it up.)</div>
<div><br></div><div>Michael</div>