Live data from Hacker News

Writing prettier Haskell with Unicode syntax and Vim

alt-romes.github.io

1–10 of 62 posts

Re: Writing prettier Haskell with Unicode syntax and Vim

#3
While I do think these look nice (appropriate even), maintaining consistency across a large team of devs is where this type of stylization breaks down. Not everyone is using the same code editor, not everyone's configuration is the same. At the end of the day it's easier to write and maintain the long-hand word versions.

Re: Writing prettier Haskell with Unicode syntax and Vim

#6
Unicode in code might be what pushes people to consider variable-width font. Just look at the simple arrow in a text editor (hopefully the text filter on this website thinks this symbol is OK): → (U+2192 RIGHTWARDS ARROW). It’s tiny. And I notice that the author uses plain `->`. You do need at least an “em” width for that kind of symbol.

But I wouldn’t want a normal variable-width font where colons are tiny and at-signs are gigantic. I read a programming email list in my regular webclient and it can be quite tiring. :)

Re: Writing prettier Haskell with Unicode syntax and Vim

#7
My favorite solution to this problem comes from the Julia community, where it's really, really nice to have your code representation of a mathematical formula look like the actual formula (because you need to work with scientists and engineers who know the formulas as math, and using the appropriate symbols makes reading it at a glance much, much easier):

LaTeX. I type \Beta, press TAB, and boom, β.

Re: Writing prettier Haskell with Unicode syntax and Vim

#8
post #5

On Linux I input special characters using the Compose key. Works everywhere, not just in Vim.

Came here to mention this exactly. I have a quick intro to the compose key on my website [0] and an intro for how to use Unicode with Latex[1], and there are other resources around the web if you are looking. The idea of a compose key for Unicode originated in Plan 9, as far as I know.

[0]: https://hakon.gylterud.net/tutorials/unicode.html

[1]: https://hakon.gylterud.net/tutorials/latex-maths-unicode.htm...

Re: Writing prettier Haskell with Unicode syntax and Vim

#10

Unicode in code might be what pushes people to consider variable-width font. Just look at the simple arrow in a text editor (hopefully the text filter on this website thinks this symbol is OK): → (U+2192 RIGHTWARDS ARROW). It’s tiny. And I notice that the author uses plain `->`. You do need at least an “em” width for that kind of symbol. But I wouldn’t want a normal variable-width font where colons are tiny and at-si…

I suppose making more characters double-width could solve this problem with minimal changes needed to terminal-based software.
Post reply on HN