News for hackers. Stuff that matters.
Re:Haskell in Production by ghkbrew on Thursday October 17, 2019 @04:56PM (#21286294)
> The $ operator is definitely confusing in Haskell

I generally think of it as a sort of open-ended parentheses that encloses the rest of the line. Instead of a backward pipe. It means "evaluate everything after this character first then apply the preceding function to it" just like parentheses would.

    print $ even $ 4 * 2
is equivalent to

    print ( even ( 4 * 2 ))
Re:Haskell in Production by brianberns on Thursday October 17, 2019 @05:02PM (#21286337)
You're right, and that's why it's usually called "function application" instead of "backward pipe". However, using $ as an operator is confusing because the associativity is ambiguous if you're not already comfortable with it.