<div dir="ltr">Thanks, Kim-Ee. Adam M's garrows look very useful for what I'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"><<a href="mailto:ky3@atamo.com" target="_blank">ky3@atamo.com</a>></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>> <span style="font-family:arial,sans-serif;font-size:13px">I have something (another circuits formulation) that's almost an arrow but doesn't support arr.</span></div>
<div><br></div>
</div><div>Have you seen Adam Megacz'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"><<a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>></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 "Fun of Programming" 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'm running into this same issue: I have something (another circuits formulation) that's almost an arrow but doesn't support arr. I'd like to use arrow notation, but then I run afoul of my missing arr. I'd like to understand Ross's suggestion and how to apply it. (I've read the "FoP" 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"><<a href="mailto:R.Paterson@city.ac.uk" target="_blank">R.Paterson@city.ac.uk</a>></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>
> Most of the conversion from arrow syntax into arrows uses 'arr' to move components around. However, arr is totally opaque to the arrow itself, and prevents describing some very useful objects as arrows.<br>
<br>
> For example, I would love to be able to use the arrow syntax to define objects of this type:<br>
<br>
> data Circuit a b where<br>
> Const :: Bool -> Circuit () Bool<br>
> Wire :: Circuit a a<br>
> Delay :: Circuit a a<br>
> And :: Circuit (Bool,Bool) Bool<br>
> Or :: Circuit (Bool,Bool) Bool<br>
> Not :: Circuit Bool Bool<br>
> Then :: Circuit a b -> Circuit b c -> Circuit a c<br>
> Pair :: Circuit a c -> Circuit b d -> Circuit (a,b) (c,d)<br>
> First :: Circuit a b -> Circuit (a,c) (b,c)<br>
> Swap :: Circuit (a,b) (b,a)<br>
> AssocL :: Circuit ((a,b),c) (a,(b,c))<br>
> AssocR :: Circuit (a,(b,c)) ((a,b),c)<br>
> Loop :: Circuit (a,b) (a,c) -> Circuit b c<br>
> etc.<br>
<br>
> Then we can have code that examines this concrete data representation, converts it to VHDL, optimizes it, etc.<br>
<br>
> However, due to the presence of the opaque 'arr', there's no way to make this type an arrow without adding an 'escape hatch'<br>
> Arr :: (a -> b) -> Circuit a b<br>
> which breaks the abstraction: circuit is supposed to represent an actual boolean circuit; (Arr not) is not a valid circuit because we've lost the information about the existence of a 'Not' 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 "Fun of Programming" 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>