Function application has precedence over any operators, so your composition is parsed as func2 . (func1 1 2)
. That is, your code tries to compose the number that's the result of func1 1 2
as if it was a function. Note that (func2 . func1) 1 2
doesn't work either, as (.)
only works with unary functions.
You could use (func2 . func1 1) 2
, or use (.)
multiple times in ways that I'm not very comfortable with personally, to tell the truth. But it's probably better to not use composition at all in this specific case: func2 $ func1 1 2
does the same thing with less clutter.