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