foo :: [(Integer,Integer)] -> Integer foo [] = 0 foo ((x,y):xs) = if x `mod` 2 == 0 then y + foo xs else foo xs(2)
bar :: Integer -> [(Integer,Integer)] bar n = [(i,j) | i <- [1..n], j <- [i..n], (i * i - j) `mod` 3 == 0]Ⅱ
28
[(1,1),(2,1),(2,2),(3,2),(3,3),(4,3),(4,4),(5,5),(6,6)]