<div dir="ltr">Hi Corentin,<br><div class="gmail_extra"><br><div class="gmail_quote">2016-06-29 10:21 GMT+02:00 Corentin Dupont <span dir="ltr"><<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Alberto,<br><br><div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Jun 28, 2016 at 10:04 AM, Alberto G. Corona <span dir="ltr"><<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Corentin:<div><br></div><div>Transient has the same behaviour than your reactive library. Your library must produce two results if you press the first and then the second button, (and more if you press them more times).</div></div></blockquote><div><br></div></span><div>Actually no, in Nomyx the events, when they occur, are "consumed" and deleted (replaced by their result).<br></div><div>So in the case of:<br><pre><code><span>True</span> <span><$</span> inputButton <span>"click here for True"</span> <span><|></span> <span>False</span> <span><$</span> inputButton<span></span> <span>"click here for False"</span></code></pre>Once one of the buttons is clicked, both disappear and the result is produced.<br></div><div>But it's merely a design choice I suppose...<br></div><span><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>In the example, return "hello" and return "world" are two different events that are triggered inmediately, and each one produces an output.</div><div><br></div><div>The Transient EDSL for Web programming has the same behaviour than yours and use the same <|></div><div><br></div><div>(submitButton "hello" `fire` OnClick) <|> (submitButton "world" `fire` onClick)</div><div><br></div><div>return either one or the other. But it can produce, like yours (I suppose) two or more results, as many events as you trigger.</div></div></blockquote><div><br></div></span><div>I like a lot Transient, I would have surely used it in Nomyx if it was around some years ago :)<br></div><div>One question is, Transient seems a lot dependant on the IO monad, would it be possible to abstract from it?<br></div><div><div><div><br></div><div><br></div></div></div></div></div></div></div></blockquote><div>That is because Transient is though as general purpose language, not an EDSL, so it has liftIO. But you can restrict it by creating your own EDSL over it:</div><div><br></div><div>newtype EDSL a= EDSL{runEDSL :: TransIO a} deriving(Monad,Applicative...</div><div><br></div><div>and export your own primitives that limit the possible IO operations.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra"><div><div><br><div class="gmail_quote">2016-06-28 0:31 GMT+02:00 Corentin Dupont <span dir="ltr"><<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Wow, it is very impressive. I need to give it more time.<br></div>I have one question regarding this example:<br><pre>main <span>=</span> keep <span>$</span> <span>do</span>
th <span><-</span> liftIO myThreadId <span>-- thread 89</span>
r <span><-</span> async (<span>do</span> threadDelay <span>1000000</span>; <span>return</span> <span><span>"</span>hello<span>"</span></span>) <span>-- thread 90</span>
<span><|></span> async (<span>return</span> <span><span>"</span>world<span>"</span></span>) <span>-- thread 91</span>
th' <span><-</span> liftIO myThreadId <span>-- thread 90 and 91</span>
liftIO <span>$</span> <span>print</span> (th, th', r) <span>-- thread 90 and 91</span></pre>
<p>Output:</p>
<pre><code>(ThreadId 89,ThreadId 91,"world")
(ThreadId 89,ThreadId 90,"hello")
</code></pre><br><div><div><div class="gmail_extra">For me it's counter-intuitive that there are two outputs. What is the reason behind?<br>It seems that the use of the <|> affects the rest of the program.<br></div><div class="gmail_extra">It looks strange to me because the two lines situated after the <|> does not look "syntactically" involved, if you see what I mean.<br></div><div class="gmail_extra">Instead I was expecting only one output, with the first thread to finish "wins".<br></div><div class="gmail_extra">In fact I implemented it like that: <a href="http://www.corentindupont.info/blog/posts/Programming/2014-09-23-Nomyx-Language.html#event-alternative-interface" target="_blank">http://www.corentindupont.info/blog/posts/Programming/2014-09-23-Nomyx-Language.html#event-alternative-interface</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers<br></div><div class="gmail_extra">Corentin<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 27, 2016 at 8:22 PM, Geraldus <span dir="ltr"><<a href="mailto:heraldhoi@gmail.com" target="_blank">heraldhoi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Sorry, here is some links:<div>Wiki paga on GitHub <a href="https://github.com/agocorona/transient/wiki/Transient-tutorial" target="_blank">https://github.com/agocorona/transient/wiki/Transient-tutorial</a></div><div>Programming at specification level <a href="https://github.com/agocorona/transient/wiki/Programming-at-the-specification-level" target="_blank">https://github.com/agocorona/transient/wiki/Programming-at-the-specification-level</a></div></div><br><div class="gmail_quote"><div dir="ltr">пн, 27 июн. 2016 г. в 23:19, Geraldus <<a href="mailto:heraldhoi@gmail.com" target="_blank">heraldhoi@gmail.com</a>>:<br></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi! Have you looked at Transient by Alberto Gomez Corona?<br><br><div class="gmail_quote"><div dir="ltr">пн, 27 июн. 2016 г. в 18:27, Corentin Dupont <<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>>:<br></div></div></div><div><div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Joachim,<br></div>I agree... I looked hard at them :)<br><a href="https://wiki.haskell.org/Functional_Reactive_Programming" target="_blank">https://wiki.haskell.org/Functional_Reactive_Programming</a><br><br></div>I need a library with a DSL able to create forms on the fly, in a "demand driven" way.<br></div>I.e. if at some point in time the user program needs a boolean from the user, a radio button will be created on the screen of that user. The objective is to retrieve the boolean, creating the form is just a way to do that. Complex forms can be created, capable of generating full ADTs. The styling of the form is not important.<br></div>Other requirements:<br></div>- it should be possible to run the event DSL in a monad different from IO.<br></div>- the event DSL need to be instance of Alternative: events can be put in concurrence, the first to fire wins.<br><br><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 27, 2016 at 10:25 AM, Joachim Breitner <span dir="ltr"><<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<span><br>
Am Montag, den 27.06.2016, 09:38 +0200 schrieb Corentin Dupont:<br>
> I need it for the game Nomyx, but couldn't find the features I wanted<br>
> from the existing libraries.<br>
<br>
</span>any chance to extend existing libraries to support what you need?<br>
Library proliferation does not really help the ecosystem.<br>
<br>
Greetings,<br>
Joachim<br>
<span><font color="#888888">--<br>
<br>
Joachim “nomeata” Breitner<br>
<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a> • <a href="https://www.joachim-breitner.de/" rel="noreferrer" target="_blank">https://www.joachim-breitner.de/</a><br>
XMPP: <a href="mailto:nomeata@joachim-breitner.de" target="_blank">nomeata@joachim-breitner.de</a> • OpenPGP-Key: 0xF0FBF51F<br>
Debian Developer: <a href="mailto:nomeata@debian.org" target="_blank">nomeata@debian.org</a></font></span><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div><br></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div></div></div></blockquote></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div data-smartmail="gmail_signature">Alberto.</div>
</font></span></div>
</blockquote></div></div></div><br></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature">Alberto.</div>
</div></div>