<div dir="ltr">Thanks, Kim-Ee. Adam M&#39;s garrows look very useful for what I&#39;m doing.  -- Conal<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 5:14 AM, Kim-Ee Yeoh <span dir="ltr">&lt;<a href="mailto:ky3@atamo.com" target="_blank">ky3@atamo.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Conal,<div class="im"><div><br></div><div>&gt; <span style="font-family:arial,sans-serif;font-size:13px">I have something (another circuits formulation) that&#39;s almost an arrow but doesn&#39;t support arr.</span></div>

<div><br></div>

</div><div>Have you seen Adam Megacz&#39;s generalized arrows?</div><div><br></div><div><a href="http://www.cs.berkeley.edu/%7Emegacz/garrows/" target="_blank">http://www.cs.berkeley.edu/~megacz/garrows/</a><span class="HOEnZb"><font color="#888888"><br>

</font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div>

</font></span><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div>-- Kim-Ee</div></font></span><div><div class="h5">
<br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 7:55 AM, Conal Elliott <span dir="ltr">&lt;<a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr"><div><div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">If you require the circuit to be <span>parametric</span> in the value types, you can limit the types of function you can pass to arr to simple plumbing.<br>






See the netlist example at the end of my &quot;Fun of Programming&quot; slides (<a href="http://www.soi.city.ac.uk/%7Eross/papers/fop.html" target="_blank">http://www.soi.<span>city</span>.ac.uk/~ross/papers/fop.html</a>).<br>





</blockquote><br></div>I&#39;m running into this same issue: I have something (another circuits formulation) that&#39;s almost an arrow but doesn&#39;t support arr. I&#39;d like to use arrow notation, but then I run afoul of my missing arr. I&#39;d like to understand Ross&#39;s suggestion and how to apply it. (I&#39;ve read the &quot;FoP&quot; slides.)<br>





<br>Ross: do you mean to say that you were able to implement arr and thus run your circuit examples via the standard arrow desugarer?<br><br>Ryan: did you get a working solution to the problem you described for your Circuit arrow?<br>





<br></div>Thanks.  -- Conal<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 6:52 PM, Paterson, Ross <span dir="ltr">&lt;<a href="mailto:R.Paterson@city.ac.uk" target="_blank">R.Paterson@city.ac.uk</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Ryan Ingram writes:<br>
&gt; Most of the conversion from arrow syntax into arrows uses &#39;arr&#39; to move components around. However, arr is totally opaque to the arrow itself, and prevents describing some very useful objects as arrows.<br>
<br>
&gt; For example, I would love to be able to use the arrow syntax to define objects of this type:<br>
<br>
&gt; data Circuit a b where<br>
&gt;     Const :: Bool -&gt; Circuit () Bool<br>
&gt;     Wire :: Circuit a a<br>
&gt;     Delay :: Circuit a a<br>
&gt;     And :: Circuit (Bool,Bool) Bool<br>
&gt;     Or :: Circuit (Bool,Bool) Bool<br>
&gt;     Not :: Circuit Bool Bool<br>
&gt;     Then :: Circuit a b -&gt; Circuit b c -&gt; Circuit a c<br>
&gt;     Pair :: Circuit a c -&gt; Circuit b d -&gt; Circuit (a,b) (c,d)<br>
&gt;     First :: Circuit a b -&gt; Circuit (a,c) (b,c)<br>
&gt;     Swap :: Circuit (a,b) (b,a)<br>
&gt;     AssocL :: Circuit ((a,b),c) (a,(b,c))<br>
&gt;     AssocR :: Circuit (a,(b,c)) ((a,b),c)<br>
&gt;     Loop :: Circuit (a,b) (a,c) -&gt; Circuit b c<br>
&gt; etc.<br>
<br>
&gt; Then we can have code that examines this concrete data representation, converts it to VHDL, optimizes it, etc.<br>
<br>
&gt; However, due to the presence of the opaque &#39;arr&#39;, there&#39;s no way to make this type an arrow without adding an &#39;escape hatch&#39;<br>
&gt;     Arr :: (a -&gt; b) -&gt; Circuit a b<br>
&gt; which breaks the abstraction: circuit is supposed to represent an actual boolean circuit; (Arr not) is not a valid circuit because we&#39;ve lost the information about the existence of a &#39;Not&#39; gate.<br>
<br>
</div>If you require the circuit to be parametric in the value types, you can limit the types of function you can pass to arr to simple plumbing.<br>
See the netlist example at the end of my &quot;Fun of Programming&quot; slides (<a href="http://www.soi.city.ac.uk/%7Eross/papers/fop.html" target="_blank">http://www.soi.city.ac.uk/~ross/papers/fop.html</a>).<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>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<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></div></div>
</blockquote></div><br></div></div>