<div dir="ltr"><div>I factored out the submit buttons.</div><div> </div><div>Now the three text boxes appear in succession above a unique button below.</div><div> </div><div><a href="http://mflowdemo.herokuapp.com/noscript/fviewmonad">http://mflowdemo.herokuapp.com/noscript/fviewmonad</a></div>

<div><br>This is the new code:</div><div> </div><div>sumWidget=  pageFlow &quot;sum&quot; $ do</div><div> </div><div>      n ←  (do<br>           n1 ←  p &lt;&lt; &quot;Enter first number&quot;       ++&gt; getInt Nothing &lt;++ br</div>

<div>           n2 ←  p &lt;&lt; &quot;Enter second number&quot; ++&gt; getInt Nothing &lt;++ br</div><div>           n3 ←  p &lt;&lt; &quot;Enter third number&quot;      ++&gt; getInt Nothing &lt;++ br<br>           return (n1+ n2 + n3))<br>

<br>          &lt;**  pageFlow &quot;button&quot; (submitButton &quot;submit&quot;)</div><div> </div><div>       p &lt;&lt;  (&quot;The result is: &quot;++show n)  ++&gt;  wlink () &lt;&lt; b &lt;&lt; &quot; menu&quot;</div>

<div>       &lt;++ p &lt;&lt; &quot;you can change the numbers in the boxes to see how the result changes&quot;</div><div> </div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/10 Adrian May <span dir="ltr">&lt;<a href="mailto:adrian.alexander.may@gmail.com" target="_blank">adrian.alexander.may@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Oh how nice!<br><br></div>I have been looking at MFlow a lot lately and I think it&#39;s got something quite special that Yesod, Happstack, etc don&#39;t seem to have, at least, not as far as I know. I mean, look at this:<br>


<br><pre><div><span>sumWidget</span><span>=</span> <span>pageFlow</span> <span>&quot;sum&quot;</span> <span>$</span> <span>do</span></div><div>
      <span>n1</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter first number&quot;</span>  <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>


<div>      <span>n2</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter second number&quot;</span> <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>


<div>      <span>n3</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter third number&quot;</span>  <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>


<div>      <span>p</span> <span>&lt;&lt;</span>  <span>(</span><span>&quot;The result is: &quot;</span><span>++</span><span>show</span> <span>(</span><span>n1</span> <span>+</span> <span>n2</span> <span>+</span> <span>n3</span><span>))</span>  <span>++&gt;</span>  <span>wlink</span> <span>()</span> <span>&lt;&lt;</span> <span>b</span> <span>&lt;&lt;</span> <span>&quot; menu&quot;</span></div>


<div>      <span>&lt;++</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;you can change the numbers in the boxes to see how the result changes&quot;</span></div>
<div><br></div></pre>Is that pretty or what? That&#39;s the code for this:<br><br><a href="http://mflowdemo.herokuapp.com/noscript/fviewmonad" target="_blank">http://mflowdemo.herokuapp.com/noscript/fviewmonad</a><br>
<br></div>To me that&#39;s a real technological step over and above the usual servlets paradigm and I&#39;d love to see more people getting involved. It seems like Yesod and Happstack have a lot more manpower behind them, but unless I&#39;ve missed something, MFlow is going somewhere new and should be helped along. <br>


 <br></div>Adrian.<br><br></div>PS. Besides Seaside, Racket is playing with the same ideas. They (Jay McCarthy) have something to say about performance but I didn&#39;t quite understand it.<br><br></div><div class="gmail_extra">


<br><br><div class="gmail_quote"><div><div class="h5">On 10 July 2013 06:41, Alberto G. Corona <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt;</span> wrote:<br></div></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div class="h5">
<div dir="ltr"><div>The third version of MFlow is out.</div><div> </div><div><a href="http://hackage.haskell.org/package/MFlow" target="_blank">http://hackage.haskell.org/package/MFlow</a></div><div> </div><div>MFlow is an all-heterodox web application framework, but very haskellish. </div>




<div> </div><div>Now MFlow support restful URLs.  It is the first stateful web framework to my knowledge that supports it. The type safe routes are implicitly expressed as normal monadic code within a navigation monad. The application look as a normal imperative console application, but the navigation monad goes back and forth to match the path of the URL. The user has control of the state, that can roll-back or not when the navigation goes back depending on the application needs. The state is in the form of normal Haskell variables In a monadic computation, with the weird addition of backtracking.</div>




<div> </div><div>The menu of the application below is implemented as an imperative-like syntax, but the application navigate forward and backward to synchronize with the requests of the web browser:</div><div><a href="http://mflowdemo.herokuapp.com/" target="_blank">http://mflowdemo.herokuapp.com/</a></div>




<div> </div><div>This version support  in-page flows.</div><div> What is that? look at this example:</div><div> </div><div><a href="http://mflowdemo.herokuapp.com/noscript/fviewmonad" target="_blank">http://mflowdemo.herokuapp.com/noscript/fviewmonad</a></div>




<div> </div><div>These flows are implemented as formlets with a monad instance, and callbacks which change the look. I call them &quot;widgets&quot;:</div><div> </div><div><a href="http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html" target="_blank">http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html</a></div>




<div> </div><div> </div><div>Each page may have many  of these active widgets, each one running their own flow. These widgets refresh themselves trough Ajax if they are enclosed in the primitive &quot;autoRefresh&quot;. If there is no Ajax or JavaScript available, they gracefully degrade by refreshing the entire page:</div>




<div> </div><div><a href="http://mflowdemo.herokuapp.com/noscript/combination" target="_blank">http://mflowdemo.herokuapp.com/noscript/combination</a></div><div> </div><div><a href="http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html" target="_blank">http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html</a></div>




<div> </div><div>The page flows and the multiflow idea was inspired in <a href="http://www.seaside.st/" target="_blank">Seaside</a>, a great Smalltalk web framework and adapted to the pure recursive nature of Haskell and the formlets.</div>




<div> </div><div>It also support some JQuery widgets integrated: modal and not modal dialogs, datePicker and other active widgets that handle other widgets.</div><div> </div><div>It also support the older features: persistent state, WAI, blaze-html and others integration, server process timeouts, Ajax, requirements, </div>




<div> content management, caching of widget rendering and all the other previous stuff.</div><div> </div><div>I wish to thank some people for their feedback. Specially Adrian May for his feedback and interest</div><span><font color="#888888"><p>


<br>

-- <br>Alberto.
</p></font></span></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Alberto.
</div>