In both cases, entry is the easy bit. Learning the notation is a somewhat orthogonal and arguably much smaller impediment than the inescapable difficulty of figuring out what you're trying to accomplish, and then how to accomplish it.
Personally I've always found math notation feels like it was optimised for space efficiency and writing speed on paper, akin to legal shorthand rather than the beauty I'm always told it has. Similarly for attempts to bring programming syntax closer to math syntax. In college I found myself translating equations of medium complexity such as the Fourier transform into pseudocode to understand.
Obviously however, my familiarity with programming notation colours my perspective as much as their experience with math notation colours theirs
>@> <$> <*> <|> <=< <+> <$> --> <&&> <||> ||| .|.
None of the above are made up, all are from real code.
If you know what those symbols mean (aka the interfaces they belong to.)
If you don't have that knowledge and are instead complaining about the fact that they have symbols period, I suggest you quit spouting answers when you should be asking questions.
data Person = Person
{ age :: Int
, name :: Text
, height :: Int
}
Person
<$> parseAge
<*> parseName
<*> parseHeight
Applicative style is one of the easiest constructs to read relative to the power of what it typically does.Most other times when you use <$>, you're using it instead of something like this:
fmap f $ x y z
Which is simplified by f <$> x y z
Google is a non-issue. Hoogle exists and works great (and can even index all symbols importable by your project) ($) :: (a → b) → a → b
(<$>) :: Functor f => (a → b) → f a → f bMathematic notation is horrible. We have to teach kids the forms for _years_ and most are still shaky at it once they're adults. You have to memorize everything because the syntax is basically shorthand, nothing is self explanatory. Then we wonder why kids struggle with math.
If a programmer decided to replace his function names with single characters from a different language he would be dope slapped by his colleges. If he always used single character variable names he would be kicked out.
To this day, when I'm reading computer science papers, I have to look really hard to make sense of the math gibbrish and get at the actual meaning, and often when I do I realize that it would have been much clearer in a few lines of JavaScript or Python or Go or Rust or just about anything else.
Well, perhaps anything except Haskell, OCaml, and similar. Even after learning the syntax, I still haven't internalized it as effortlessly as I did with other languages. Note that lisp is not very algol-like and I have a much easier time parsing it than I do Haskell despite relatively equal familiarity. I think Haskell has given us a lot of great ideas, and thankfully they've filtered down from the Ivory Tower of academic languages into pragmatic mainstream languages, such as Rust.
Haskell syntax is not more complex than an Algol descended language. It's only confusing if you expect an Algol descended language, for example because you're already familiar with them.
When I first learned Haskell, I only knew C. Haskell codebases were immediately so fun to dive into and learn from. I wouldn't hesitate to hit the "Source" button on Hackage. The fact that all code could be reasoned about locally with just simple symbolic substitution was a breath of fresh air.
To a person with 0 experience at all, Haskell or Algol-descended languages are going to be equally alien. Your experience is because you had asymmetric familiarity.
So I'm not surprised by your experience. But it says more about you than Haskell.