プログラミング・パラダイム(2014 年度)テスト解答例(一部)


(1)
  foo []     = False
  foo (x:xs) = x < 0 || foo xs
(2)
  bar n = [(i,j) | i<-[1..n], j<-[i..n], i*j `mod` 8 == 0 ]

(1) [2,9]
(2) [(1,2),(1,4),(1,6),(3,2),(3,4),(5,2)]