<div class="gmail_quote">Oh,  I´m stupid. You mean web pages with multiple tabs....<br><br> I have not tested it. but each tab can be handled easily by a different server process.. or it can be handled in a single server process, like in a menu. For example, this code present different options, and the process renders different things depending on the response.<div>


<br></div><div>The last option is a link to a different process, while the others( wlinks) are links that return back to the same process.</div><div>The operator &lt;|&gt; is the applicative operator.  a breakline is prepended to each link:<br>


<br>data Ops= Ints | Strings | Actions | Ajax | Opt deriving(Typeable,Read, Show)<br> <br> mainf=   do<br>        r &lt;- ask $   wlink Ints (bold &lt;&lt; &quot;increase an Int&quot;)<br>                &lt;|&gt;  br ++&gt; wlink Strings (bold &lt;&lt; &quot;increase a String&quot;)<br>


                &lt;|&gt;  br ++&gt; wlink Actions (bold &lt;&lt; &quot;Example of a string widget with an action&quot;)<br>                &lt;|&gt;  br ++&gt; wlink Ajax (bold &lt;&lt; &quot;Simple AJAX example&quot;)<br>


                &lt;|&gt;  br ++&gt; wlink Opt (bold &lt;&lt; &quot;select options&quot;)<br>                &lt;++ (br +++ linkShop) -- this is an ordinary XHtml link<br><br>        case r of<br>          Ints    -&gt;  clickn 0<br>


          Strings -&gt;  clicks &quot;1&quot;<br>          Actions -&gt;  actions 1<br>          Ajax    -&gt;  ajaxsample<br>          Opt     -&gt;  options<br>        mainf<br>     where<br>     linkShop= toHtml $ hotlink  &quot;shop&quot; &lt;&lt; &quot;shopping&quot;<br>


<br>.<br>Alberto<br><br>2012/9/18 Alberto G. Corona &lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt;:<div><div class="h5"><br>&gt; Hi Jake<br>&gt;<br>&gt; I don´t know what you mean with multiple tabs. The user management is<br>


&gt; simple, anonymous clients are identified with  a cookie. if the user<br>&gt; is logged (MFlow has widgets for logging-validation) the user is the<br>&gt; identifier.<br>&gt;<br>&gt; The state of a process is associated to the client identifier and to<br>


&gt; the path invoked in the url requested.<br>&gt;<br>&gt; I don´t know if this answer your question....<br>&gt;<br>&gt; Alberto<br>&gt;<br>&gt; 2012/9/18 Jake McArthur &lt;<a href="mailto:jake.mcarthur@gmail.com" target="_blank">jake.mcarthur@gmail.com</a>&gt;:<br>


&gt;&gt; This sounds really cool.<br>&gt;&gt;<br>&gt;&gt; How do you handle users having multiple tabs?<br>&gt;&gt;<br>&gt;&gt; On Tue, Sep 18, 2012 at 11:26 AM, Alberto G. Corona &lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt; wrote:<br>


&gt;&gt;&gt; Hi haskellers and specially the web developers.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; <a href="http://hackage.haskell.org/package/MFlow-0.1.5.3" target="_blank">http://hackage.haskell.org/package/MFlow-0.1.5.3</a><br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt; MFlow is a is a Web framework with some unique, and I mean unique,<br>&gt;&gt;&gt; characteristics that I find exciting:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; - It is a Web application server that start and restart on-demand<br>


&gt;&gt;&gt; stateful web server processes (not request.-response)<br>&gt;&gt;&gt;   This means that all the page navigation can be coded in a single<br>&gt;&gt;&gt; procedure. This increases readability of the programmer code. I woul<br>


&gt;&gt;&gt; call it<br>&gt;&gt;&gt; a anti-node.js.  Buit usual request-response (stateless) server<br>&gt;&gt;&gt; processes are also allowed<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; - When the process is invoqued as result of an URL request, the Web<br>


&gt;&gt;&gt; app server not only restart the process but also recover its execution<br>&gt;&gt;&gt; state. The enclosing Workflow monad provides the thread state<br>&gt;&gt;&gt; persistence. There are state timeouts and process timeouts defined by<br>


&gt;&gt;&gt; the programmer. Processes with no persistent state (transient) are<br>&gt;&gt;&gt; possible.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -The user interface is made of widgets. They are  formlets with added<br>&gt;&gt;&gt; formatting,   attributes, validations, modifiers and callbacks, that<br>


&gt;&gt;&gt; are composable, so the pieces are reusable and return type safe<br>&gt;&gt;&gt; responses to the calling process. Even the links are part of widgets<br>&gt;&gt;&gt; and return back type safe inputs at compile time to the calling server<br>


&gt;&gt;&gt; process. Tho glue these components, ordinary applicative combinators<br>&gt;&gt;&gt; and other extra combinators are used.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; - The widgets and the communication don´t make assumptions about the<br>


&gt;&gt;&gt; architecture, so it can be adapted to non-web environments. This<br>&gt;&gt;&gt; versions has interface for WAI-warp, Hack, Text.XHtml (xhtml) , and<br>&gt;&gt;&gt; Haskell Server Pages.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -The widget rendering can be converted to ByteStrings automatically<br>


&gt;&gt;&gt; with special combinators. A mix of widgets with different formats can<br>&gt;&gt;&gt; be combined in the same source file. For example Text.Html and HSP<br>&gt;&gt;&gt; (Haskell server pages)<br>&gt;&gt;&gt;<br>


&gt;&gt;&gt; -These widgets can be cached, to avoid widget rendering on every interaction.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -To handle the back button, and because the processes are stateful,<br>&gt;&gt;&gt; they can run backwards until the response match. This is transparent<br>


&gt;&gt;&gt; for the programmer, thanks to the embedded FlowM monad.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -All the code is in pure Haskell. No deployment, special scripts,<br>&gt;&gt;&gt; formats etc are necessary.<br>&gt;&gt;&gt;<br>


&gt;&gt;&gt; -Besides automatic state persistence, TCache provides transactions and<br>&gt;&gt;&gt; user data persistence, that can be configured for SQL databases.<br>&gt;&gt;&gt; Default persistence in files permit very rapid prototyping. Just code<br>


&gt;&gt;&gt; and run it with runghc.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -Has AJAX support<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; All of this sounds very complicated, but really it is simple!. Most of<br>&gt;&gt;&gt; these things are transparent. The resulting code is quite readable and<br>


&gt;&gt;&gt; has very little plumbing!<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; There is a non trivial example that some of these functionalities<br>&gt;&gt;&gt; embedded here that you can run:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;  <a href="http://hackage.haskell.org/packages/archive/MFlow/0.1.5.3/doc/html/MFlow-Forms.html" target="_blank">http://hackage.haskell.org/packages/archive/MFlow/0.1.5.3/doc/html/MFlow-Forms.html</a><br>


&gt;&gt;&gt;<br>&gt;&gt;&gt; Take a look and tell me your opinion.  I hope that you find it as<br>&gt;&gt;&gt; exciting as me.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;  I´m looking for people  to collaborate in the development of MFlow.<br>


&gt;&gt;&gt;<br>&gt;&gt;&gt; Although still it is experimental, it is being used in at least one<br>&gt;&gt;&gt; future commercial project. So I have te commitment to continue its<br>&gt;&gt;&gt; development. There are many examples in the documentation and in the<br>


&gt;&gt;&gt; package.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Alberto<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Haskell mailing list<br>&gt;&gt;&gt; <a href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>


&gt;&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">http://www.haskell.org/mailman/listinfo/haskell</a><br><br></div></div></div>
</div><br>