Project Euler Problem 1 - Multiples of 3 and 5 I wrote this function for Project Euler Problem 1. 

prob001 :: (Integral a) =&gt; [a] -&gt; [a] -&gt; a
prob001 a b = sum [x | x &lt;- a, product ( map (x `rem`) b ) == 0]


The use is like this

GHCi&gt; prob001 [1..999] [3, 5]
233168


But I am not at all satisfied with it. The list comprehension looks like something I have taken from Python. But I think the predicate can be much more efficient if it were written as a short-circuiting function. Currently it will have to evaluate each of these.

I am not able to think how to write that part in a short-circuiting way without a variable to hold the values. Am I correct in thinking that or not? Anything other that I can improve here?
I think that any is your friend here.

aMultipleOf factors x = any (\f -&gt; x `rem` f == 0) factors
prob001 :: (Integral a) =&gt; [a] -&gt; [a] -&gt; a
prob001 nums factors = sum $ filter (aMultipleOf factors) nums