foo :: [Integer] -> Integer foo [] = 0 foo (x:xs) = (if x `mod` 3 == 0 then 1 else 0) + foo xs
bar :: Integer -> [(Integer,Integer)] bar n = [(i,j)| i <- [1..n], j <- [i..n], i * j `mod` 12 == 0 ]