Hello Jeremy,<br>I&#39;m still trying to integrate web routes, but there is one thing I don&#39;t understand:<br>how to deal with multiple forms?<br><br>In my former application, each forms used to redirect to a subdirectory of the web site, and an appropriate handler was waiting there.<br>
But now with web routes I don&#39;t see how to do that.<br>I&#39;ve tried to push down the decision over subdirectories (with the guard &quot;dir&quot;) inside the RouteT monad:<br><br><span style="font-family: courier new,monospace;">type NomicServer       = ServerPartT IO</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">type RoutedNomicServer = RouteT PlayerCommand NomicServer</span><br><br><span style="font-family: courier new,monospace;">nomicSite :: ServerHandle -&gt; Site PlayerCommand (NomicServer Html)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">nomicSite sh = setDefault (Noop 0) Site {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      handleSite         = \f url -&gt; unRouteT (routedNomicHandle sh url) f</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    , formatPathSegments = \u -&gt; (toPathSegments u, [])</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    , parsePathSegments  = parseSegments fromPathSegments</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicHandle :: ServerHandle -&gt; PlayerCommand -&gt; RoutedNomicServer Html</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicHandle sh pc = do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   d &lt;- liftRouteT $ liftIO getDataDir</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   msum [dir &quot;Login&quot; $ loginPage,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         dir &quot;postLogin&quot; $ postLogin,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         --nullDir &gt;&gt; fileServe [] d,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         dir &quot;NewRule&quot; $ newRule sh,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         dir &quot;NewGame&quot; $ newGameWeb sh,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         dir &quot;Nomic&quot; $ routedNomicCommands sh pc]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicCommands :: ServerHandle -&gt; PlayerCommand -&gt; RoutedNomicServer Html</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicCommands sh (Noop pn)                   = nomicPageComm pn sh (return ())</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicCommands sh (JoinGame pn game)          = nomicPageComm pn sh (joinGame game pn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicCommands sh (LeaveGame pn)              = nomicPageComm pn sh (leaveGame pn)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicCommands sh (SubscribeGame pn game)     = nomicPageComm pn sh (subscribeGame game pn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicCommands sh (UnsubscribeGame pn game)   = nomicPageComm pn sh (unsubscribeGame game pn)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicCommands sh (Amend pn)                  = nomicPageComm pn sh (amendConstitution pn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicCommands sh (DoAction pn an ar)         = nomicPageComm pn sh (doAction&#39; an ar pn)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">routedNomicCommands sh (NewRule pn name text code) = nomicPageComm pn sh (submitRule name text code pn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">routedNomicCommands sh (NewGame pn game)           = nomicPageComm pn sh (newGame game pn)</span><br style="font-family: courier new,monospace;">
<br><br><span style="font-family: courier new,monospace;">loginPage :: RoutedNomicServer Html</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">loginPage = do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   l &lt;- loginForm</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   ok $ H.html $ do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      H.head $ do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        H.title (H.string &quot;Login to Nomic&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        H.link ! rel &quot;stylesheet&quot; ! type_ &quot;text/css&quot; ! href &quot;/static/css/nomic.css&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        H.meta ! A.httpEquiv &quot;Content-Type&quot; ! content &quot;text/html;charset=utf-8&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        H.meta ! A.name &quot;keywords&quot; ! A.content &quot;Nomic, game, rules, Haskell, auto-reference&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      H.body $ do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        H.div ! A.id &quot;container&quot; $ do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">           H.div ! A.id &quot;header&quot; $ &quot;Login to Nomic&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">           H.div ! A.id &quot;login&quot; $ l</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">           H.div ! A.id &quot;footer&quot; $ &quot;footer&quot;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">loginForm :: RoutedNomicServer Html</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">loginForm = do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   ok $ H.form ! A.method &quot;POST&quot; ! A.action &quot;/postLogin&quot; ! enctype &quot;multipart/form-data;charset=UTF-8&quot;  $ do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      H.label ! for &quot;login&quot; $ &quot;Login&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      input ! type_ &quot;text&quot; ! name &quot;login&quot; ! A.id &quot;login&quot; ! tabindex &quot;1&quot; ! accesskey &quot;L&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      H.label ! for &quot;password&quot; $ &quot;Password&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      input ! type_ &quot;text&quot; ! name &quot;password&quot; ! A.id &quot;password&quot; ! tabindex &quot;2&quot; ! accesskey &quot;P&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      input ! type_  &quot;submit&quot; ! tabindex &quot;3&quot; ! accesskey &quot;S&quot; ! value &quot;Enter Nomic!&quot;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">postLogin :: RoutedNomicServer Html</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">postLogin = do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">  methodM POST -- only accept a post method</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  mbEntry &lt;- getData -- get the data</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  case mbEntry of</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Nothing -&gt; error $ &quot;error: postLogin&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    Just (LoginPass login password)  -&gt; do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">      mpn &lt;- liftRouteT $ liftIO $ newPlayerWeb login password</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      case mpn of</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         Just pn -&gt; do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            link &lt;- showURL $ Noop pn</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            seeOther link $ string &quot;Redirecting...&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         Nothing -&gt; seeOther (&quot;/Login?status=fail&quot; :: String) $ string &quot;Redirecting...&quot;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">launchWebServer :: ServerHandle -&gt; IO ()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">launchWebServer sh = do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   putStrLn &quot;Starting web server...\nTo connect, drive your browser to \&quot;<a href="http://localhost:8000/Login\">http://localhost:8000/Login\</a>&quot;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   simpleHTTP nullConf $ implSite &quot;<a href="http://localhost:8000/">http://localhost:8000/</a>&quot; &quot;&quot; (nomicSite sh)</span><br><br><br>But when I drive my browser to &quot;<a href="http://localhost:8000/Login/">http://localhost:8000/Login/</a>&quot;, happstack tell me there is nothing here.<br>
Am I doing it right? If yes, I must have made a mistake.<br>(as you can see I&#39;m still far from putting in disgestive functors ;)<br><br>If you need, the complete application can be found here (see file Web.hs): <a href="https://github.com/cdupont/Nomic">https://github.com/cdupont/Nomic</a> <br>
<br>Thanks,<br>Corentin<br><br><div class="gmail_quote">On Wed, Jan 19, 2011 at 5:12 PM, Corentin Dupont <span dir="ltr">&lt;<a href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks Jeremy.<br>I had it to work now ;)<br><font color="#888888"><br>Corentin</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Jan 18, 2011 at 6:01 PM, Jeremy Shaw <span dir="ltr">&lt;<a href="mailto:jeremy@n-heptane.com" target="_blank">jeremy@n-heptane.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello,<br>
<br>
trhsx will be installed in ~/.cabal/bin, so you will need to add that<br>
to your PATH.<br>
<br>
In order to use the demo code I provided you would need the latest<br>
happstack from darcs because it contains a few differences in the API.<br>
The code can be made to work with what is on hackage though.<br>
<br>
The submit issue is actually a bug in digestive-functors-blaze. The<br>
return type should be, Form m i e BlazeFormHtml (). jaspervdj is going<br>
to patch it and upload a new version.<br>
<br>
- jeremy<br>
<br>
<br>
On Thu, Jan 13, 2011 at 2:40 PM, Corentin Dupont<br>
<div><div></div><div>&lt;<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m using the combination happstack + digestive-functors + web-routes +<br>
&gt; blazeHTML.<br>
&gt; I&#39;m not finding any examples on the net...<br>
&gt;<br>
&gt; I&#39;ve tried to adapt your example (thanks):<br>
&gt;<br>
&gt; type NomicForm a = HappstackForm IO String BlazeFormHtml a<br>
&gt;<br>
&gt; demoForm :: NomicForm (Text, Text)<br>
&gt; demoForm =<br>
&gt;     (,) &lt;$&gt; ((TDB.label &quot;greeting: &quot; ++&gt; inputNonEmpty Nothing) &lt;* br)<br>
&gt;         &lt;*&gt; ((TDB.label &quot;noun: &quot;     ++&gt; inputNonEmpty Nothing) &lt;* br)<br>
&gt;         &lt;*  (submit &quot;submit&quot;)<br>
&gt;     where<br>
&gt;       br :: NomicForm ()<br>
&gt;       br = view H.br<br>
&gt;       -- make sure the fields are not blank, show errors in line if they are<br>
&gt;       inputNonEmpty :: Maybe Text -&gt; NomicForm Text<br>
&gt;       inputNonEmpty v =<br>
&gt;           (inputText v `validate` (TD.check &quot;You can not leave this field<br>
&gt; blank.&quot; (not . T.null)) &lt;++ errors)<br>
&gt;<br>
&gt;<br>
&gt; But I&#39;ve got a problem on submit and inputText. I don&#39;t see how they are<br>
&gt; compatible with HappstackForm.<br>
&gt; NomicForm a reduces to:<br>
&gt; Form (ServerPartT IO) Input String BlazeFormHtml a<br>
&gt;<br>
&gt; whereas the type of submit is:<br>
&gt;<br>
&gt; submit :: Monad m<br>
&gt;<br>
&gt;        =&gt; String                            -- ^ Text on the submit button<br>
&gt;<br>
&gt;        -&gt; Form m String e BlazeFormHtml ()  -- ^ Submit button<br>
&gt;<br>
&gt;<br>
&gt; Maybe I miss some instance?<br>
&gt;<br>
&gt; BTW, I also tried to execute your exemple, but I can&#39;t install some<br>
&gt; packages.<br>
&gt;<br>
&gt;&gt; cabal install digestive-functors-hsp<br>
&gt;<br>
&gt; cabal: Unknown build tool trhsx<br>
&gt;<br>
&gt; Whereas trhsx is in my PATH (under linux).<br>
&gt;<br>
&gt; You said I need the latest happstack from darcs, why?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Corentin<br>
&gt;<br>
&gt; On Sun, Jan 9, 2011 at 8:36 PM, Jeremy Shaw &lt;<a href="mailto:jeremy@n-heptane.com" target="_blank">jeremy@n-heptane.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; newRule also needs to have the type, RoutedNomicServer. The<br>
&gt;&gt; transformation of RoutedNomicServer into NomicServer is done in the<br>
&gt;&gt; handleSite function. Something like this:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; nomicSpec :: ServerHandle -&gt; Site Route (ServerPartT IO Response)<br>
&gt;&gt; nomicSpec sh =<br>
&gt;&gt;      Site { handleSite          = \f url -&gt; unRouteT (nomicSite sh url) f<br>
&gt;&gt;             ...<br>
&gt;&gt;<br>
&gt;&gt; main =<br>
&gt;&gt;    do ...<br>
&gt;&gt;      simpleHTTP nullConf $ siteImpl (nomicSpec sh)<br>
&gt;&gt;<br>
&gt;&gt; Or something like that -- it&#39;s hard to tell exactly what is going on<br>
&gt;&gt; in your app based on the snippets you provided.<br>
&gt;&gt;<br>
&gt;&gt; Also, I highly recommend using digestive functors instead of formlets.<br>
&gt;&gt; It is the successor to formlets. Same core idea, better implementation<br>
&gt;&gt; and actively maintained.<br>
&gt;&gt;<br>
&gt;&gt; I have attached a quick demo of using:<br>
&gt;&gt;<br>
&gt;&gt; happstack+digestive-functors+web-routes+HSP<br>
&gt;&gt;<br>
&gt;&gt; To use it you will need the latest happstack from darcs plus:<br>
&gt;&gt;<br>
&gt;&gt;  hsp<br>
&gt;&gt;  web-routes<br>
&gt;&gt;  web-routes-hsp<br>
&gt;&gt;  web-routes-happstack<br>
&gt;&gt;  web-routes-mtl<br>
&gt;&gt;  digestive-functors<br>
&gt;&gt;  digestive-functors-hsp<br>
&gt;&gt;<br>
&gt;&gt; I plan to clean up this example and document it better in the crash<br>
&gt;&gt; course for the upcoming release. Clearly things like the FormInput<br>
&gt;&gt; instance and the formPart function belong a library.<br>
&gt;&gt;<br>
&gt;&gt; let me know if you have more questions.<br>
&gt;&gt; - jeremy<br>
&gt;&gt;<br>
&gt;&gt; On Sat, Jan 8, 2011 at 6:44 PM, Corentin Dupont<br>
&gt;&gt; &lt;<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hello,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have difficulties mixing web-routes and forms:<br>
&gt;&gt; &gt; I have put routes in all my site, except for forms which remains with<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; type ServerPartT IO Response.<br>
&gt;&gt; &gt; How to make them work together?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have:<br>
&gt;&gt; &gt; type NomicServer             = ServerPartT IO<br>
&gt;&gt; &gt; type RoutedNomicServer = RouteT PlayerCommand NomicServer<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; newRule :: ServerHandle -&gt; NomicServer Response<br>
&gt;&gt; &gt; newRule sh = do<br>
&gt;&gt; &gt;    methodM POST -- only accept a post method<br>
&gt;&gt; &gt;    mbEntry &lt;- getData -- get the data<br>
&gt;&gt; &gt;    case mbEntry of<br>
&gt;&gt; &gt;       Nothing -&gt; error $ &quot;error: newRule&quot;<br>
&gt;&gt; &gt;       Just (NewRule name text code pn) -&gt; do<br>
&gt;&gt; &gt;          html &lt;- nomicPageComm pn sh (submitRule name text code pn))<br>
&gt;&gt; &gt;          ok $ toResponse html<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; nomicPageComm :: PlayerNumber -&gt; ServerHandle -&gt; Comm () -&gt;<br>
&gt;&gt; &gt; RoutedNomicServer Html<br>
&gt;&gt; &gt; nomicPageComm pn sh comm =<br>
&gt;&gt; &gt; (..)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; launchWebServer :: ServerHandle -&gt; IO ()<br>
&gt;&gt; &gt; launchWebServer sh = do<br>
&gt;&gt; &gt;    putStrLn &quot;Starting web server...\nTo connect, drive your browser to<br>
&gt;&gt; &gt; \&quot;<a href="http://localhost:8000/Login%5C" target="_blank">http://localhost:8000/Login\</a>&quot;&quot;<br>
&gt;&gt; &gt;    d &lt;- liftIO getDataDir<br>
&gt;&gt; &gt;    simpleHTTP nullConf $ mconcat [dir &quot;postLogin&quot; $ postLogin,<br>
&gt;&gt; &gt;                                   fileServe [] d,<br>
&gt;&gt; &gt;                                   dir &quot;Login&quot; $ ok $ toResponse $<br>
&gt;&gt; &gt; loginPage,<br>
&gt;&gt; &gt;                                   dir &quot;NewRule&quot; $ newRule sh,<br>
&gt;&gt; &gt;                                   dir &quot;NewGame&quot; $ newGameWeb sh,<br>
&gt;&gt; &gt;                                   dir &quot;Nomic&quot; $ do<br>
&gt;&gt; &gt;                                      html &lt;- implSite<br>
&gt;&gt; &gt; &quot;<a href="http://localhost:8000/Nomic/" target="_blank">http://localhost:8000/Nomic/</a>&quot; &quot;&quot; (nomicSite sh)<br>
&gt;&gt; &gt;                                      ok $ toResponse html<br>
&gt;&gt; &gt;                                   ]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The red line doesn&#39;t compile. I don&#39;t know how to transform a<br>
&gt;&gt; &gt; RoutedNomicServer into a NomicServer.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; For the future I intend to use formlets: is these some examples of<br>
&gt;&gt; &gt; programs<br>
&gt;&gt; &gt; using happstack + web-routes + formlets?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt; Corentin<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Jan 7, 2011 at 5:10 PM, Jeremy Shaw &lt;<a href="mailto:jeremy@n-heptane.com" target="_blank">jeremy@n-heptane.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hello,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The [(String, String)] argument is for adding query parameters.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; encodePathInfo [&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;] [(&quot;key&quot;,&quot;value&quot;)]<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &quot;foo/bar/baz?key=value&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Instead of showURL you would use showURLParams.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; hope this helps!d<br>
&gt;&gt; &gt;&gt; - jeremy<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Fri, Jan 7, 2011 at 8:12 AM, Corentin Dupont<br>
&gt;&gt; &gt;&gt; &lt;<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Hello Jeremy,<br>
&gt;&gt; &gt;&gt; &gt; I&#39;m using Web routes with happstack.<br>
&gt;&gt; &gt;&gt; &gt; I&#39;m following this tutorial:<br>
&gt;&gt; &gt;&gt; &gt; <a href="http://tutorialpedia.org/tutorials/Happstack+type+safe+URLs.html" target="_blank">http://tutorialpedia.org/tutorials/Happstack+type+safe+URLs.html</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; But It seems out of synch with the latest version of web-routes:<br>
&gt;&gt; &gt;&gt; &gt; 0.23.2.<br>
&gt;&gt; &gt;&gt; &gt; The haddock documentation seems out of date also:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; encodePathInfo :: [String] -&gt; [(String, String)] -&gt; String<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; For example:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;  encodePathInfo [\&quot;foo\&quot;, \&quot;bar\&quot;, \&quot;baz\&quot;]<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &quot;foo/bar/baz&quot;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; And I can&#39;t figure out what this [(String, String)] is for ;)<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Corentin<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>