Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> chc: I do not think Parsec would be better off if "<|>" were renamed to "parsecOR"

> sanderjd: I do think Parsec would be better off if "<|>" were something like "parsecOR"

Do you think perhaps some people think about functions visually while others think about them auditorily?

An IDE could easily render function names however the human reader wants. The option whether to render function names as names or symbols would be customizable, just like the display colors for various element types are.

Within each option, there's further choices. For names, there could be a choice between various natural languages. For symbols, it could be restricted to ASCII e.g. <|>, or full Unicode, e.g. | enclosed by a non-spacing diamond.



For what it's worth, Emacs already does that last thing. As a contrived example borrowed from a post I wrote a while back[1]:

    \ a b c -> a >= b && b <= c || a /= c
gets rendered as:

    λ a b c → a ≥ b ∧ b ≤ c ∨ a ≢ c
However, this is a bit of a pain to do in general. It works well for common functions and syntax elements, but has to be built into the editor. Doing it more generally would require the author of the initial function to come up with multiple different names for it, which sounds unlikely.

[1]: https://news.ycombinator.com/item?id=4742616


Your examples are terser which many programmers would prefer.

> Doing it more generally would require the author of the initial function to come up with multiple different names for it, which sounds unlikely.

Unlikely for now, but could become more likely in the future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: