<div dir="ltr"><div class="gmail_extra">On Sat, Aug 17, 2013 at 8:23 AM, Mathijs Kwik <span dir="ltr">&lt;<a href="mailto:mathijs@bluescreen303.nl" target="_blank">mathijs@bluescreen303.nl</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">damodar kulkarni &lt;<a href="mailto:kdamodar2000@gmail.com">kdamodar2000@gmail.com</a>&gt; writes:<br>

<br>
&gt; Thanks for this nice analogy and explanation. This brings &quot;monad<br>
&gt; transformers&quot; to my mind.<br>
&gt; &quot;without&quot; monad transformers, the monads are bit crippled in their<br>
&gt; applicability (please correct me if I am wrong)<br>
&gt; and<br>
&gt; &quot;with&quot; monad transformers the code becomes to some extent ugly (again,<br>
&gt; please correct me if I am wrong)<br>
&gt;<br>
&gt; I wonder, where and how the Monad transformers fit in here?<br>
<br>
</div>Well, I&#39;m glad you all liked my explanation =)<br>
<br>
Let me first correct 1 stupid mistake I wrote in the first paragraph:<br>
<div class="im">- Every idiom is an arrow and every arrow is a monad, but not the other<br>
  way around.<br>
</div>should obviously be:<br>
+ Every Monad is an Arrow (with ArrowApply) and every Arrow is an Idiom,<br>
<div class="im">  but not the other way around.<br></div></blockquote><div><br></div><div style>Every Idiom defines a static arrow:</div><div style><br></div><div style>newtype Static f a b = Static (f (a -&gt; b))</div>
<div style><br></div><div style>instance Applicative f =&gt; Arrow (Static f)</div><div style><br></div><div style><br></div><div style>Similarly, every arrow defines an idiom:</div><div style><br></div><div style>newtype WrappedArrow a b c = WrappedArrow (a b c)</div>
<div style><br></div><div style>instance Arrow a =&gt; Applicative (WrappedArrow a b)</div><div style><br></div><div style><br></div><div style>The difference is that WrappedArrow (Static f) () is essentially the same as f, but Static (WrappedArrow a ()) is not necessarily the same as a.</div>
<div style><br></div><div style>Basically, if an arrow can be made an instance of ArrowDelay, then it is no more powerful than an Idiom (meaning anything you can write using the arrow combinators can also be written with just the Applicative combinators):</div>
<div style><br></div><div style>class Arrow a =&gt; ArrowDelay a where</div><div style>    delay :: a b c -&gt; a () (b -&gt; c)</div><div><br></div></div>-- <br>Dave Menendez &lt;<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>&gt;<br>
&lt;<a href="http://www.eyrie.org/~zednenem/">http://www.eyrie.org/~zednenem/</a>&gt;
</div></div>