Precedence, Operators, and Fixity

Pointfree style is a great example of the flexibility that Haskell’s syntax can afford you in writing code that’s short and to the point. Since Haskell’s grammar requires very little in the way of additional punctuation to separate out different parts of an expression, pointfree style feels like a natural evolution of Haskell’s already generally minimalist style. The downside of both pointfree style specifically, and Haskell’s lightweight syntax in general, is that it relies on implicit rules about how things are parsed, rather than explicit punctuation where characters and symbols are used to tell both the compiler and the reader how to parse the code.

Thankfully, although these parsing rules are implicit and ...

Get Effective Haskell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.