<div dir="ltr"><div><div><div><div>I'm actually a fan of using Unicode in my code. As people like to say, code is read more often than it's written, so I'm willing to make typing a bit harder in return for making the code prettier.<br>
<br></div>Happily, typing Unicode characters is quite easy with a good editor (Emacs). I use the TeX input mode which just lets me use TeX names for symbols, but somebody has actually written a Haskell-specific mode which might be even better[1]. I might try it some day.<br>
<br></div><div>One peculiar habit I have is using x₁ x₂ x₃ instead of x1, x2, x3 or x_1, x_2, x_3. I definitely find the Unicode version easier to read and work with, although it probably helps that Emacs highlights the number in a different color.<br>
</div><div><br></div>Unfortunately, this is a minority opinion at the moment. Even in *this* day and age, people still find Unicode too difficult to type!<br><br></div>For my internal code, this is not a problem, but it's kept me from putting any Unicode in public APIs. Shame.<br>
<br></div>I also don't use UnicodeSyntax because Emacs can do most of the transformations transparently for me without changing the underlying file. You can turn this on by setting `haskell-font-lock-symbols' to t. I find it makes for much nicer code that's easier to read and, even more importantly, easier to skim.<br>
<br>[1]: <a href="https://github.com/roelvandijk/emacs-haskell-unicode-input-method">https://github.com/roelvandijk/emacs-haskell-unicode-input-method</a><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Apr 24, 2014 at 12:51 PM, Roel van Dijk <span dir="ltr"><<a href="mailto:vandijk.roel@gmail.com" target="_blank">vandijk.roel@gmail.com</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>I think it is a nice feature if used sparingly.</div><div><br></div><div>Note that while Unicode symbols are a normal part of the Haskell language you can also turn on some Unicode syntax using the UnicodeSyntax [1] language extension. This means the following will be accepted by GHC:</div>


<div><br></div>(∈) ∷ ∀ α. Eq α ⇒ α → [α] → Bool<br>(∈) = elem<div><br></div><div>You might want to take a look at some packages I created that define some Unicode symbols for common operators and values [2, 3, 4].</div><div>


<br></div><div>Opinions on whether this is a good idea vary. My anecdotal observation is that it seems to be used more by people who speak a native language that is already poorly served by ASCII. Perhaps because they are already used to not being able to simply type every character they need. </div>


<div><br><div>1 - <a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#unicode-syntax" target="_blank">http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#unicode-syntax</a></div>
<div>
2 - <a href="http://www.haskell.org/haskellwiki/Unicode-symbols" target="_blank">http://www.haskell.org/haskellwiki/Unicode-symbols</a><br>
</div></div><div>3 - <a href="http://hackage.haskell.org/package/base-unicode-symbols" target="_blank">http://hackage.haskell.org/package/base-unicode-symbols</a></div><div>4 - <a href="http://hackage.haskell.org/package/containers-unicode-symbols" target="_blank">http://hackage.haskell.org/package/containers-unicode-symbols</a></div>


</div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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>