<div dir="ltr">I&#39;m reading through <a href="http://www.cse.chalmers.se/~rjmh/afp-arrows.pdf">http://www.cse.chalmers.se/~rjmh/afp-arrows.pdf</a><br><div><br></div><div style>I was following it up until this example in the section about flip-flops:</div>
<div style><br></div><div style><div><font face="courier new, monospace">class Arrow arr =&gt; ArrowLoop arr where</font></div><div><font face="courier new, monospace">  loop :: arr (a,c) (b,c) -&gt; arr a b</font></div><div>
<font face="courier new, monospace"><br></font></div></div><div style><div><font face="courier new, monospace">instance ArrowLoop (-&gt;) where</font></div><div><font face="courier new, monospace">  loop f a = b</font></div>
<div><font face="courier new, monospace">    where (b,c) = f (a,c)</font></div><div><br></div><div style>Although I&#39;ve never seen a function declaration like this, but I think I get it. Because<font face="courier new, monospace"> f :: (a, c) -&gt; (b, c)</font> then then <font face="courier new, monospace">loop f :: ((a, c) -&gt; (b, c)) -&gt; (a -&gt; b)</font> which is the same as  <font face="courier new, monospace">((a, c) -&gt; (b, c)) -&gt; a -&gt; b</font>.</div>
<div style><br></div><div style>However, I don&#39;t see where the <font face="courier new, monospace">c</font> comes from in <font face="courier new, monospace">f (a,c)</font>. Is this a mistake or am I missing something? A friend of mine realized that this is just a recursive definition so<font face="courier new, monospace"> f (a, c) == f (a, snd $ f (a, snd $ f (a, ...)))</font>. I don&#39;t really understand this definition. I can see how it compiles, but I don&#39;t see how it would ever produce a legitimate value. Do I have to assume that<font face="courier new, monospace"> f</font> never evaluates the second element in the pair and just passes it through?</div>
</div></div>