My Haskell code is as follows
isNotPrime x = elem 0 map (mod x)[3.. (x-1)]
When compiled it shows these errors
Couldn't match expected type ‘(t1 -> t1) -> [t1] -> t’
with actual type ‘Bool’
The function ‘elem’ is applied to four arguments,
but its type ‘([a0] -> [b0])
-> ((a0 -> b0) -> [a0] -> [b0]) -> Bool’
has only two
In the expression: elem 0 map (mod x) [3 .. (x - 1)]
In an equation for ‘prime’:
prime x = elem 0 map (mod x) [3 .. (x - 1)]
My understanding is that elem accepts two arguments, I do not understand how am I passing 4 arguments in the above code as the map function should just return a list.