Parentheses in Haskell aren’t really related to function application, they are only for grouping. It makes more sense if you avoid using them unless strictly necessary.
In Haskell instead of `f(g(x))` we would write `f (g x)`, and instead of `f(x,g(y),z)` we would write `f x (g y) z`. You could use more parentheses but it would be more confusing, such as `(f)(x)(g(y))(z)`.
On Sun, Jun 28, 2020 at 05:50 Josh Friedlander <[hidden email]> wrote:
Thanks Francesco, that works. I don't quite understand what the issue was, though. Specifically:
- Did the parentheses around (xs) hurt, or were they just redundant?
- Wouldn't the parentheses around (head ...) be binding it as an argument to whatever comes before (in this case, 3)?