Hacker News new | past | comments | ask | show | jobs | submit login

Syntax is easy to learn if you know the mathematical concepts. The other way around... not so much.



all those symbols in haskell aren't really helping, even if the syntax is easy to learn...


Most of the funky symbols in Haskell are library defined operators. You can define your own in a single line of code. They behave just like functions, just with an infix syntax by default, instead of prefix.

You can use Hoogle (eg https://www.stackage.org/lts-6.9/hoogle?q=%3E%3E%3D) to look them up.

It's a bit daunting at first. But most code actually only uses operators from at most a few libraries. Once you understand Monoid, Applicatives and Monads and their operators, you'll be doing OK.

There are alphabetic names for their operators. But they are not used much---working programmers prefer the symbols. Alas, learning wouldn't be much easier with them either, because most of the work is in understanding the concepts. People would complain just as much about the cryptic names as about the cryptic symbols.

(The only mainstream library that really goes crazy with the symbols is 'lens'.)


hm maybe you're right.

I saw one of the problems was, that I had higher math in German and some translations aren't straight forward (monoid -> halbgruppe) so I often thought things I knew were entirely new concepts.


Oh, if you had some higher math you are already ahead of the game. (I did the same, but I got lucky and had heard of Monoide even in German.)

Yes, it's a bit of a shame that some things are so abstract that we can really give it good names. For example, the operation in the monoid is just any old operation that's associative. What name do you want to call that? I don't see anything that improves on the little Kringel that we make on the black-board, or the <> that Haskell uses.




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

Search: