<div>Iavor: Wow, I really like the &gt;--c--&gt; trick at the type level.</div><div><br></div><div>Note: we can shorten that somewhat and improve the fixity to associate correctly, matching the associativity of (-&gt;), which fortunately associates to the right. (associating to the left can be done with a similar trick, based on the original version of this hack by Chung-Chieh Shan.)</div>
<div><br></div><div>
<font face="courier new, monospace">{-# LANGUAGE TypeOperators, PolyKinds #-}</font></div><div><font face="courier new, monospace">import Control.Category</font></div><div><font face="courier new, monospace"><br></font></div>

<div><font face="courier new, monospace">infixr 0 &gt;~</font></div><div><font face="courier new, monospace">infixr 0 ~&gt;</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">type (&gt;~) a b = b a</font></div>

<div><font face="courier new, monospace">type (~&gt;) a b = a b</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">g :: Category c =&gt; (x &gt;~c~&gt; y) -&gt; (y &gt;~c~&gt; z) -&gt; x &gt;~c~&gt; z</font></div>

<div><font face="courier new, monospace">g = undefined</font></div><div><br></div><div>Note, this also has the benefit of picking the correct associativity for &gt;~c~&gt;. Unlike naively using a locally bound (~&gt;) and avoids the headaches of picking (--&gt;) and (---&gt;) or something equally hideous when working with two categories.</div>
<div><br></div><div><div><font face="courier new, monospace">class (Category c, Category d) =&gt; CFunctor f c d | f c -&gt; d, f d -&gt; c where</font></div><div><font face="courier new, monospace">  cmap :: (a &gt;~c~&gt; b) -&gt; f a &gt;~d~&gt; f b</font></div>
</div><div><br></div>
<div>-Edward</div><div><br></div><div class="gmail_quote">On Mon, Sep 17, 2012 at 1:02 PM, Sjoerd Visscher <span dir="ltr">&lt;<a href="mailto:sjoerd@w3future.com" target="_blank">sjoerd@w3future.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>Note that nobody was suggesting two pragmas with incompatible behaviors, only to have just one symbol reserved to still be able to have type operator variables.<div>

<br></div><div>I do like your suggestion, although &gt;--c--&gt; is quite a bit longer than ~&gt;.</div><span><font color="#888888"><div><br></div><div>Sjoerd</div></font></span><div><br><div><div><div>
<div>On Sep 17, 2012, at 6:28 PM, Iavor Diatchki wrote:</div><br></div></div><blockquote type="cite"><div><div>Hello,<br><br><div class="gmail_quote">I think that it would be a mistake to have two pragmas with incompatible behaviors:  for example, we would not be able to write modules that use Conal&#39;s libraries and, say, the type nats I&#39;ve been working on.</div>


<div class="gmail_quote">If the main issue is the notation for arrows, has anoyone played with what can be done with the current (7.6) system?  I just thought of two variations that seem to provide a decent notation for writing arrow-ish programs.  The second one, in particular, mirrors the arrow notation at the value level, so perhaps that would be enough?</div>


<div class="gmail_quote"><br></div><div class="gmail_quote">-Iavor</div><div class="gmail_quote"><br></div><div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><div class="gmail_quote">


<font face="courier new, monospace">{-# LANGUAGE TypeOperators, KindSignatures #-}</font></div><div class="gmail_quote"><font face="courier new, monospace">module Test where</font></div><div class="gmail_quote"><font face="courier new, monospace"><br>


</font></div><div class="gmail_quote"><font face="courier new, monospace">import Control.Category </font></div><div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">-- Variant 1: Post-fix annotation</font></div>


<div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">type (a ---&gt; b) c = c a b</font></div><div class="gmail_quote"><font face="courier new, monospace"><br>


</font></div><div class="gmail_quote"><font face="courier new, monospace">f :: Category c =&gt; (x ---&gt; y) c -&gt; (y ---&gt; z) c -&gt; (x ---&gt; z) c</font></div><div class="gmail_quote"><font face="courier new, monospace">f = undefined</font></div>


<div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">-- Variant 2: Arrow notation</font></div>


<div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">type a &gt;-- (c :: * -&gt; * -&gt; *) = c a</font></div><div class="gmail_quote">


<font face="courier new, monospace">type c --&gt; b                  = c b</font></div><div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">infix 2 &gt;--</font></div>


<div class="gmail_quote"><font face="courier new, monospace">infix 1 --&gt;</font></div><div class="gmail_quote"><font face="courier new, monospace"><br></font></div><div class="gmail_quote"><font face="courier new, monospace">g :: Category c =&gt; (x &gt;--c--&gt; y) -&gt; (y &gt;--c--&gt; z) -&gt; (x &gt;--c--&gt; z)</font></div>


<div class="gmail_quote"><font face="courier new, monospace">g = undefined</font></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div></div></div><div>
_______________________________________________<br>Glasgow-haskell-users mailing list<br><a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">Glasgow-haskell-users@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>

</div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br></blockquote></div><br>