<div dir="ltr">This ticket might be relevant <a href="https://ghc.haskell.org/trac/ghc/ticket/11046">https://ghc.haskell.org/trac/ghc/ticket/11046</a></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-10 20:51 GMT+05:00 John Leo <span dir="ltr"><<a href="mailto:leo@halfaya.org" target="_blank">leo@halfaya.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">I sent this to haskell-cafe a little while ago but didn't get a response, so I thought I'd try here. I'd guess this is a case of the GHC user guide needing an update, but I'd like an expert opinion.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">---</span></div><span style="font-size:12.8px"><div><span style="font-size:12.8px"><br></span></div>According to sections 7.4.3 and 7.4.4 of the latest GHC documentation</span><div><div style="font-size:12.8px"><a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/data-type-extensions.html" target="_blank">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/data-type-extensions.html</a></div><div style="font-size:12.8px">you can define (7.4.3) an infix type constructor as long as it begins with a <span>colon</span>, for example</div><div style="font-size:12.8px"><font face="monospace, monospace">data a :*: b = Foo a b</font><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">and furthermore (7.4.4) you can define an infix operator without having to use a <span>colon</span> if you enable the TypeOperators extension:</div><div style="font-size:12.8px"><font face="monospace, monospace">data a * b = Foo a b</font></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">However if I try the former without using TypeOperators I get this compiler error in 7.10.2:</div><div style="font-size:12.8px"><div><font face="monospace, monospace"> Illegal declaration of a type or class operator ‘:*:’</font></div><div><font face="monospace, monospace"> Use TypeOperators to declare operators in type and declarations</font></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Using TypeOperators fixes this, but then * without <span>colon</span> also works so I don't see the point of using <span>colon</span> anymore.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">My guess is this was some some kind of historical distinction which is no longer valid and the documentation needs to be updated. Is this true, or am I missing something?</div><span class="HOEnZb"><font color="#888888"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">John</div></font></span></div></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>