<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 <|> 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 <- ask $ wlink Ints (bold << "increase an Int")<br> <|> br ++> wlink Strings (bold << "increase a String")<br>
<|> br ++> wlink Actions (bold << "Example of a string widget with an action")<br> <|> br ++> wlink Ajax (bold << "Simple AJAX example")<br>
<|> br ++> wlink Opt (bold << "select options")<br> <++ (br +++ linkShop) -- this is an ordinary XHtml link<br><br> case r of<br> Ints -> clickn 0<br>
Strings -> clicks "1"<br> Actions -> actions 1<br> Ajax -> ajaxsample<br> Opt -> options<br> mainf<br> where<br> linkShop= toHtml $ hotlink "shop" << "shopping"<br>
<br>.<br>Alberto<br><br>2012/9/18 Alberto G. Corona <<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>>:<div><div class="h5"><br>> Hi Jake<br>><br>> I don´t know what you mean with multiple tabs. The user management is<br>
> simple, anonymous clients are identified with a cookie. if the user<br>> is logged (MFlow has widgets for logging-validation) the user is the<br>> identifier.<br>><br>> The state of a process is associated to the client identifier and to<br>
> the path invoked in the url requested.<br>><br>> I don´t know if this answer your question....<br>><br>> Alberto<br>><br>> 2012/9/18 Jake McArthur <<a href="mailto:jake.mcarthur@gmail.com" target="_blank">jake.mcarthur@gmail.com</a>>:<br>
>> This sounds really cool.<br>>><br>>> How do you handle users having multiple tabs?<br>>><br>>> On Tue, Sep 18, 2012 at 11:26 AM, Alberto G. Corona <<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>> wrote:<br>
>>> Hi haskellers and specially the web developers.<br>>>><br>>>> <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>
>>><br>
>>> MFlow is a is a Web framework with some unique, and I mean unique,<br>>>> characteristics that I find exciting:<br>>>><br>>>> - It is a Web application server that start and restart on-demand<br>
>>> stateful web server processes (not request.-response)<br>>>> This means that all the page navigation can be coded in a single<br>>>> procedure. This increases readability of the programmer code. I woul<br>
>>> call it<br>>>> a anti-node.js. Buit usual request-response (stateless) server<br>>>> processes are also allowed<br>>>><br>>>> - When the process is invoqued as result of an URL request, the Web<br>
>>> app server not only restart the process but also recover its execution<br>>>> state. The enclosing Workflow monad provides the thread state<br>>>> persistence. There are state timeouts and process timeouts defined by<br>
>>> the programmer. Processes with no persistent state (transient) are<br>>>> possible.<br>>>><br>>>> -The user interface is made of widgets. They are formlets with added<br>>>> formatting, attributes, validations, modifiers and callbacks, that<br>
>>> are composable, so the pieces are reusable and return type safe<br>>>> responses to the calling process. Even the links are part of widgets<br>>>> and return back type safe inputs at compile time to the calling server<br>
>>> process. Tho glue these components, ordinary applicative combinators<br>>>> and other extra combinators are used.<br>>>><br>>>> - The widgets and the communication don´t make assumptions about the<br>
>>> architecture, so it can be adapted to non-web environments. This<br>>>> versions has interface for WAI-warp, Hack, Text.XHtml (xhtml) , and<br>>>> Haskell Server Pages.<br>>>><br>>>> -The widget rendering can be converted to ByteStrings automatically<br>
>>> with special combinators. A mix of widgets with different formats can<br>>>> be combined in the same source file. For example Text.Html and HSP<br>>>> (Haskell server pages)<br>>>><br>
>>> -These widgets can be cached, to avoid widget rendering on every interaction.<br>>>><br>>>> -To handle the back button, and because the processes are stateful,<br>>>> they can run backwards until the response match. This is transparent<br>
>>> for the programmer, thanks to the embedded FlowM monad.<br>>>><br>>>> -All the code is in pure Haskell. No deployment, special scripts,<br>>>> formats etc are necessary.<br>>>><br>
>>> -Besides automatic state persistence, TCache provides transactions and<br>>>> user data persistence, that can be configured for SQL databases.<br>>>> Default persistence in files permit very rapid prototyping. Just code<br>
>>> and run it with runghc.<br>>>><br>>>> -Has AJAX support<br>>>><br>>>> All of this sounds very complicated, but really it is simple!. Most of<br>>>> these things are transparent. The resulting code is quite readable and<br>
>>> has very little plumbing!<br>>>><br>>>> There is a non trivial example that some of these functionalities<br>>>> embedded here that you can run:<br>>>><br>>>> <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>
>>><br>>>> Take a look and tell me your opinion. I hope that you find it as<br>>>> exciting as me.<br>>>><br>>>> I´m looking for people to collaborate in the development of MFlow.<br>
>>><br>>>> Although still it is experimental, it is being used in at least one<br>>>> future commercial project. So I have te commitment to continue its<br>>>> development. There are many examples in the documentation and in the<br>
>>> package.<br>>>><br>>>> Alberto<br>>>><br>>>> _______________________________________________<br>>>> Haskell mailing list<br>>>> <a href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>
>>> <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>