<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Simply efficient functional reactivity</title>
	<atom:link href="http://conal.net/blog/posts/simply-efficient-functional-reactivity/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity</link>
	<description>Inspirations &#38; experiments, mainly about denotative/functional programming in Haskell</description>
	<lastBuildDate>Sat, 26 Sep 2020 21:06:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.17</generator>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-88</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Tue, 30 Jun 2009 18:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-88</guid>
		<description><![CDATA[&lt;p&gt;Hi Ivan.  I don&#039;t have easy access to the detailed differences.  There was very little change (lots of revision already). Mainly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplified the definition of &lt;code&gt;joinE&lt;/code&gt; in 7.2.2&lt;/li&gt;
&lt;li&gt;Simplified (a bit) the &lt;code&gt;unamb&lt;/code&gt; &quot;reference implementation&quot; in Figure 4, noting that it is not an efficient implementation.&lt;/li&gt;
&lt;/ul&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hi Ivan.  I don&#8217;t have easy access to the detailed differences.  There was very little change (lots of revision already). Mainly:</p>

<ul>
<li>Simplified the definition of <code>joinE</code> in 7.2.2</li>
<li>Simplified (a bit) the <code>unamb</code> &#8220;reference implementation&#8221; in Figure 4, noting that it is not an efficient implementation.</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivan</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-87</link>
		<dc:creator><![CDATA[ivan]]></dc:creator>
		<pubDate>Tue, 30 Jun 2009 15:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-87</guid>
		<description><![CDATA[&lt;p&gt;Could you post a changelog between the most recent version of this paper and the new push-pull functional reactive programming paper, please?&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Could you post a changelog between the most recent version of this paper and the new push-pull functional reactive programming paper, please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conal Elliott &#187; Blog Archive &#187; Why classic FRP does not fit interactive behavior</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-86</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Why classic FRP does not fit interactive behavior]]></dc:creator>
		<pubDate>Wed, 10 Dec 2008 06:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-86</guid>
		<description><![CDATA[&lt;p&gt;[...] The Arrow style required multiple behaviors to be bunched up into one. That combination appears to thwart efficient, change-driven evaluation, which was the problem I tackled in Simply efficient functional reactivity. [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] The Arrow style required multiple behaviors to be bunched up into one. That combination appears to thwart efficient, change-driven evaluation, which was the problem I tackled in Simply efficient functional reactivity. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-85</link>
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 30 Aug 2008 09:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-85</guid>
		<description><![CDATA[&lt;p&gt;So, when are you going to release the library that goes with this paper? I&#039;m really looking forward to playing around with this stuff!&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>So, when are you going to release the library that goes with this paper? I&#8217;m really looking forward to playing around with this stuff!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-84</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Wed, 07 May 2008 17:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-84</guid>
		<description><![CDATA[&lt;p&gt;Thanks, Jake!  There were two mistakes.  Errata and paper source updated.  Here&#039;s the correct code:&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;joinR &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;a `Stepper` Ev ur&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; `Stepper` Ev urr&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; =
  a `stepper` Ev u
 &lt;span style=&quot;color: #050; font-weight: bold;&quot;&gt;where&lt;/span&gt;
   u = &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;`switcher` Ev urr&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; &lt;$&gt; ur&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; `&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Monoid.html#v:mappend&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;mappend&lt;/span&gt;&lt;/a&gt;` &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;join &lt;$&gt; urr&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Thanks, Jake!  There were two mistakes.  Errata and paper source updated.  Here&#8217;s the correct code:</p>

<p><div>
<pre class="haskell">joinR <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>a `Stepper` Ev ur<span style="color: green;">&#41;</span> `Stepper` Ev urr<span style="color: green;">&#41;</span> =
  a `stepper` Ev u
 <span style="color: #050; font-weight: bold;">where</span>
   u = <span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>`switcher` Ev urr<span style="color: green;">&#41;</span> &lt;$&gt; ur<span style="color: green;">&#41;</span> `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Monoid.html#v:mappend" rel="nofollow"><span style="font-weight: bold;">mappend</span></a>` <span style="color: green;">&#40;</span>join &lt;$&gt; urr<span style="color: green;">&#41;</span></pre>
</div></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake McArthur</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-83</link>
		<dc:creator><![CDATA[Jake McArthur]]></dc:creator>
		<pubDate>Wed, 07 May 2008 16:32:44 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-83</guid>
		<description><![CDATA[&lt;p&gt;I discovered an error on page 8. Your definition of joinR:&lt;/p&gt;

&lt;pre&gt;
joinR :: Reactive (Reactive a) -&gt; Reactive a
joinR :: ((a `Stepper` Ev ur) `Stepper` Ev urr) =
         a `Stepper` Ev u
     where u = ((`switcher` e&#039;)  ur) `mappend` (join  urr)
&lt;/pre&gt;

&lt;p&gt;Before completing the definition of &lt;code&gt;u&lt;/code&gt;, you say that it is the first of either &lt;code&gt;(`switcher` Ev ur) &lt;$&gt; ur&lt;/code&gt; or &lt;code&gt;join  urr&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In actual definition of &lt;code&gt;u&lt;/code&gt; in your paper, you use &lt;code&gt;e&#039;&lt;/code&gt;, which was never bound. I believe &lt;code&gt;e&#039;&lt;/code&gt; is supposed to be &lt;code&gt;Ev urr&lt;/code&gt;. Before completing the definition of &lt;code&gt;u&lt;/code&gt;, your intermediate code (&lt;code&gt;(`switcher` Ev ur) &lt;$&gt; ur&lt;/code&gt;) uses neither &lt;code&gt;e&#039;&lt;/code&gt; nor &lt;code&gt;Ev urr&lt;/code&gt;, but uses &lt;code&gt;Ev ur&lt;/code&gt; instead.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I discovered an error on page 8. Your definition of joinR:</p>

<pre>
joinR :: Reactive (Reactive a) -&gt; Reactive a
joinR :: ((a `Stepper` Ev ur) `Stepper` Ev urr) =
         a `Stepper` Ev u
     where u = ((`switcher` e')  ur) `mappend` (join  urr)
</pre>

<p>Before completing the definition of <code>u</code>, you say that it is the first of either <code>(`switcher` Ev ur) &lt;$&gt; ur</code> or <code>join  urr</code>.</p>

<p>In actual definition of <code>u</code> in your paper, you use <code>e'</code>, which was never bound. I believe <code>e'</code> is supposed to be <code>Ev urr</code>. Before completing the definition of <code>u</code>, your intermediate code (<code>(`switcher` Ev ur) &lt;$&gt; ur</code>) uses neither <code>e'</code> nor <code>Ev urr</code>, but uses <code>Ev ur</code> instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-82</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Wed, 30 Apr 2008 19:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-82</guid>
		<description><![CDATA[&lt;p&gt;Hi Josef,&lt;/p&gt;

&lt;p&gt;I started out with that simpler definition.  Here&#039;s what I think is a problem with it: Concurrent Haskell has no atomic operation for reading an &lt;code&gt;MVar&lt;/code&gt;.  The &lt;code&gt;readMVar&lt;/code&gt; action instead does a &lt;code&gt;takeMVar&lt;/code&gt; followed by a &lt;code&gt;putMVar&lt;/code&gt;.  After the reader&#039;s &lt;code&gt;takeMVar&lt;/code&gt; and before its &lt;code&gt;putMVar&lt;/code&gt;, the race-loser could unblock and do its &lt;code&gt;putMVar&lt;/code&gt;.  This second &lt;code&gt;putMVar&lt;/code&gt; to the same &lt;code&gt;MVar&lt;/code&gt; would break the pure semantics &lt;em&gt;and&lt;/em&gt; would cause the reader to block instead of completing its &lt;code&gt;readMVar&lt;/code&gt;. I hadn&#039;t considered this possibility until Ivan Tomac pointed it out.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hi Josef,</p>

<p>I started out with that simpler definition.  Here&#8217;s what I think is a problem with it: Concurrent Haskell has no atomic operation for reading an <code>MVar</code>.  The <code>readMVar</code> action instead does a <code>takeMVar</code> followed by a <code>putMVar</code>.  After the reader&#8217;s <code>takeMVar</code> and before its <code>putMVar</code>, the race-loser could unblock and do its <code>putMVar</code>.  This second <code>putMVar</code> to the same <code>MVar</code> would break the pure semantics <em>and</em> would cause the reader to block instead of completing its <code>readMVar</code>. I hadn&#8217;t considered this possibility until Ivan Tomac pointed it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josef Svenningsson</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-81</link>
		<dc:creator><![CDATA[Josef Svenningsson]]></dc:creator>
		<pubDate>Wed, 30 Apr 2008 15:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-81</guid>
		<description><![CDATA[&lt;p&gt;I have a very small question about the race function defined at the end of the paper. Is the lock MVar really necessary? I think not but maybe I&#039;m just missing something. In the run function couldn&#039;t you just write to the v MVar first and then kill the other thread. Then double kill will be prevented because the other thread will block when trying to assing to the MVar and will never reach the killThread before being killed himself.&lt;/p&gt;

&lt;pre&gt;
a `race` b =
  do  v &lt;- newEmptyMVar
      let run io tid = forkIO $ do x &lt;- io
                                   putMVar v x
                                   killThread tid
      mdo ta &lt;- run a tb
          tb &lt;- run b ta
      readMVar v&lt;/pre&gt;

&lt;p&gt;Well, maybe this issue is moot anyway since you and Ryan Ingram seem to have come up with some nicer way of doing this.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I have a very small question about the race function defined at the end of the paper. Is the lock MVar really necessary? I think not but maybe I&#8217;m just missing something. In the run function couldn&#8217;t you just write to the v MVar first and then kill the other thread. Then double kill will be prevented because the other thread will block when trying to assing to the MVar and will never reach the killThread before being killed himself.</p>

<pre>
a `race` b =
  do  v &lt;- newEmptyMVar
      let run io tid = forkIO $ do x &lt;- io
                                   putMVar v x
                                   killThread tid
      mdo ta &lt;- run a tb
          tb &lt;- run b ta
      readMVar v</pre>

<p>Well, maybe this issue is moot anyway since you and Ryan Ingram seem to have come up with some nicer way of doing this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-80</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Tue, 29 Apr 2008 23:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-80</guid>
		<description><![CDATA[&lt;p&gt;Ryan: I see what you mean, now.  I think the following two special cases fix this problem, inserted before the one in the paper (quoted in your most recent comment):&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;Future &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;Max MaxBound,_&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; `mergeu` v = v
u `mergeu` Future &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;Max MaxBound,_&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; = u&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I just added these lines to the implementation.  Thanks for pointing out the leak.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Ryan: I see what you mean, now.  I think the following two special cases fix this problem, inserted before the one in the paper (quoted in your most recent comment):</p>

<p><div>
<pre class="haskell">Future <span style="color: green;">&#40;</span>Max MaxBound,_<span style="color: green;">&#41;</span> `mergeu` v = v
u `mergeu` Future <span style="color: green;">&#40;</span>Max MaxBound,_<span style="color: green;">&#41;</span> = u</pre>
</div></p>

<p>I just added these lines to the implementation.  Thanks for pointing out the leak.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Ingram</title>
		<link>http://conal.net/blog/posts/simply-efficient-functional-reactivity#comment-79</link>
		<dc:creator><![CDATA[Ryan Ingram]]></dc:creator>
		<pubDate>Tue, 29 Apr 2008 22:23:20 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/posts/simply-efficient-functional-reactivity/#comment-79</guid>
		<description><![CDATA[&lt;p&gt;For (2), yes.  I found it very interesting that given the interface to future could be that minimal (four small typeclasses &amp; two or three additional operations) and all of the &quot;definition&quot;-side of behavior/reactive/event could be specified in terms of that minimal interface.&lt;/p&gt;

&lt;p&gt;Of course you need to plumb into the implementation details when you are writing the interpretation functions (occs/sinkE/sinkR), unless you take waitFor and force as primitive as well, which severely constrains the design of Future.  But most client code can absolutely ignore that and use the behavior/reactive/event abstraction.&lt;/p&gt;

&lt;p&gt;(3) From your definition of mappend on events:&lt;/p&gt;

&lt;pre&gt;
u `mergeu` v = (inFutR (`merge` v) &lt;$&gt; u)
           &lt;+&gt; (inFutR (u `merge`) &lt;$&gt; v)
   where
       inFutR f (r `Stepper` Ev u0) = r `Stepper` Ev (f u0)
&lt;/pre&gt;

&lt;p&gt;Consider the case where v = never.  The rhs of &lt;+&gt; goes away, but we still call &quot;merge&quot; in the lhs, and pass v again.  So any storage held by v cannot be reclaimed, and there&#039;s also a time leak as &lt;+&gt; keeps getting called needlessly.&lt;/p&gt;

&lt;p&gt;The more merges that happen, the worse the leak gets.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>For (2), yes.  I found it very interesting that given the interface to future could be that minimal (four small typeclasses &amp; two or three additional operations) and all of the &#8220;definition&#8221;-side of behavior/reactive/event could be specified in terms of that minimal interface.</p>

<p>Of course you need to plumb into the implementation details when you are writing the interpretation functions (occs/sinkE/sinkR), unless you take waitFor and force as primitive as well, which severely constrains the design of Future.  But most client code can absolutely ignore that and use the behavior/reactive/event abstraction.</p>

<p>(3) From your definition of mappend on events:</p>

<pre>
u `mergeu` v = (inFutR (`merge` v) &lt;$&gt; u)
           &lt;+&gt; (inFutR (u `merge`) &lt;$&gt; v)
   where
       inFutR f (r `Stepper` Ev u0) = r `Stepper` Ev (f u0)
</pre>

<p>Consider the case where v = never.  The rhs of &lt;+&gt; goes away, but we still call &#8220;merge&#8221; in the lhs, and pass v again.  So any storage held by v cannot be reclaimed, and there&#8217;s also a time leak as &lt;+&gt; keeps getting called needlessly.</p>

<p>The more merges that happen, the worse the leak gets.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
