Your use of
mutliplesOfKLessThanN is not correct
Is not interpreted by Haskell as
but instead it is interpteted as
multiplesOfKLessThanNto the result.
I think your misconception is in how function application occurs. In many languages function application requires parentheses e.g.
f(x). For Haskell parentheses, only ever mean do this operation first, and function application is achieved by putting things next to each other. So
f(x) works in Haskell because it is the same as
f x, but
f(x y) is the same as
f(x(y)) and tells Haskell to evaluate
x y first and then give it to
With your code Haskell can’t apply
(3,5) as a function, which is what Haskell is telling you, it expected a function (in fact a specific type of function).
The proper way to write this would be
multiplesOfKLessThanN (3,5) 1000
This should handle that main error you are getting.